From a14f9066f098cd80ef22899007cb6222d6bc8bf0 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 4 Apr 2011 21:14:07 +0200 Subject: [PATCH] profile: Remove useless wrappers --- src/connman.h | 7 ------- src/network.c | 14 +++++++------- src/profile.c | 31 ------------------------------- 3 files changed, 7 insertions(+), 45 deletions(-) diff --git a/src/connman.h b/src/connman.h index 76b816b..fa7e4c3 100644 --- a/src/connman.h +++ b/src/connman.h @@ -436,13 +436,6 @@ int __connman_profile_remove(const char *path); void __connman_profile_changed(gboolean delayed); -int __connman_profile_add_device(struct connman_device *device); -int __connman_profile_remove_device(struct connman_device *device); - -int __connman_profile_add_network(struct connman_network *network); -int __connman_profile_update_network(struct connman_network *network); -int __connman_profile_remove_network(struct connman_network *network); - int __connman_tethering_init(void); void __connman_tethering_cleanup(void); diff --git a/src/network.c b/src/network.c index f3282dc..e7ae5d6 100644 --- a/src/network.c +++ b/src/network.c @@ -381,12 +381,12 @@ void connman_network_set_group(struct connman_network *network, if (g_strcmp0(network->group, group) == 0) { if (group != NULL) - __connman_profile_update_network(network); + __connman_service_update_from_network(network); return; } if (network->group != NULL) { - __connman_profile_remove_network(network); + __connman_service_remove_from_network(network); g_free(network->group); } @@ -394,7 +394,7 @@ void connman_network_set_group(struct connman_network *network, network->group = g_strdup(group); if (network->group != NULL) - __connman_profile_add_network(network); + __connman_service_create_from_network(network); } /** @@ -1733,9 +1733,9 @@ static int network_probe(struct connman_element *element) case CONNMAN_NETWORK_TYPE_CELLULAR: case CONNMAN_NETWORK_TYPE_WIFI: case CONNMAN_NETWORK_TYPE_WIMAX: - if (network->group != NULL) - __connman_profile_add_network(network); - break; + if (network->group != NULL && + __connman_service_create_from_network(network) == NULL) + return -EINVAL; } return 0; @@ -1764,7 +1764,7 @@ static void network_remove(struct connman_element *element) case CONNMAN_NETWORK_TYPE_WIFI: case CONNMAN_NETWORK_TYPE_WIMAX: if (network->group != NULL) { - __connman_profile_remove_network(network); + __connman_service_remove_from_network(network); g_free(network->group); network->group = NULL; diff --git a/src/profile.c b/src/profile.c index e6a397b..e0d9994 100644 --- a/src/profile.c +++ b/src/profile.c @@ -192,37 +192,6 @@ void __connman_profile_changed(gboolean delayed) changed_timeout = g_timeout_add_seconds(1, services_changed, NULL); } -int __connman_profile_add_network(struct connman_network *network) -{ - struct connman_service *service; - - DBG("network %p", network); - - service = __connman_service_create_from_network(network); - if (service == NULL) - return -EINVAL; - - return 0; -} - -int __connman_profile_update_network(struct connman_network *network) -{ - DBG("network %p", network); - - __connman_service_update_from_network(network); - - return 0; -} - -int __connman_profile_remove_network(struct connman_network *network) -{ - DBG("network %p", network); - - __connman_service_remove_from_network(network); - - return 0; -} - static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg, void *data) { -- 2.7.4