Also do some cleanup. Signed-off-by: Dongxiao Xu <dongxiao...@intel.com> --- applet/main.c | 8 ++++---- common/connman-client.c | 4 ++-- common/connman-dbus.c | 28 +--------------------------- common/connman-dbus.h | 5 +---- common/instance.c | 2 +- common/instance.xml | 2 +- common/test-config.c | 6 +++--- common/test-dbus.c | 4 ++-- 8 files changed, 15 insertions(+), 44 deletions(-)
diff --git a/applet/main.c b/applet/main.c index 73a8f85..73c915e 100644 --- a/applet/main.c +++ b/applet/main.c @@ -83,7 +83,7 @@ static void update_service(DBusGProxy *proxy, const char *path) } service = dbus_g_proxy_new_from_proxy(proxy, - "org.moblin.connman.Service", path); + "net.connman.Service", path); properties_create(service, service_property_changed, NULL); } @@ -116,8 +116,8 @@ static DBusGProxy *manager = NULL; static void manager_init(DBusGConnection *connection) { - manager = dbus_g_proxy_new_for_name(connection, "org.moblin.connman", - "/", "org.moblin.connman.Manager"); + manager = dbus_g_proxy_new_for_name(connection, "net.connman", + "/", "net.connman.Manager"); properties_create(manager, manager_property_changed, NULL); } @@ -130,7 +130,7 @@ static void manager_cleanup(void) static void name_owner_changed(DBusGProxy *proxy, const char *name, const char *prev, const char *new, gpointer user_data) { - if (g_str_equal(name, "org.moblin.connman") == FALSE) + if (g_str_equal(name, "net.connman") == FALSE) return; if (*new != '\0') { diff --git a/common/connman-client.c b/common/connman-client.c index fcbc851..29f68c1 100644 --- a/common/connman-client.c +++ b/common/connman-client.c @@ -274,7 +274,7 @@ static gboolean device_scan(GtkTreeModel *model, GtkTreePath *path, return FALSE; if (g_str_equal(dbus_g_proxy_get_interface(proxy), - CONNMAN_DEVICE_INTERFACE) == FALSE) + CONNMAN_SERVICE_INTERFACE) == FALSE) return FALSE; connman_propose_scan(proxy, NULL); @@ -317,7 +317,7 @@ static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path, return FALSE; if (g_str_equal(dbus_g_proxy_get_interface(proxy), - CONNMAN_NETWORK_INTERFACE) == FALSE) + CONNMAN_SERVICE_INTERFACE) == FALSE) return FALSE; connman_disconnect(proxy, NULL); diff --git a/common/connman-dbus.c b/common/connman-dbus.c index a21109b..d753830 100644 --- a/common/connman-dbus.c +++ b/common/connman-dbus.c @@ -407,47 +407,21 @@ static void manager_changed(DBusGProxy *proxy, const char *property, if (property == NULL || value == NULL) return; - if (g_str_equal(property, "State") == TRUE) { - ConnmanClientCallback callback; - gpointer userdata; - gchar *state; - - state = g_object_get_data(G_OBJECT(store), "State"); - g_free(state); - - state = g_value_dup_string(value); - g_object_set_data(G_OBJECT(store), "State", state); - - callback = g_object_get_data(G_OBJECT(store), "callback"); - userdata = g_object_get_data(G_OBJECT(store), "userdata"); - if (callback) - callback(state, userdata); - } else if (g_str_equal(property, "Services") == TRUE) { + if (g_str_equal(property, "Services") == TRUE) property_update(store, value, service_properties); - } } static void manager_properties(DBusGProxy *proxy, GHashTable *hash, GError *error, gpointer user_data) { GtkTreeStore *store = user_data; - ConnmanClientCallback callback; GValue *value; - gchar *state; DBG("store %p proxy %p hash %p", store, proxy, hash); if (error != NULL || hash == NULL) return; - value = g_hash_table_lookup(hash, "State"); - state = value ? g_value_dup_string(value) : NULL; - g_object_set_data(G_OBJECT(store), "State", state); - - callback = g_object_get_data(G_OBJECT(store), "callback"); - if (callback) - callback(state, NULL); - value = g_hash_table_lookup(hash, "Services"); if (value != NULL) property_update(store, value, service_properties); diff --git a/common/connman-dbus.h b/common/connman-dbus.h index c16ca09..cfca50e 100644 --- a/common/connman-dbus.h +++ b/common/connman-dbus.h @@ -22,7 +22,7 @@ #include <dbus/dbus-glib.h> #include <gtk/gtk.h> -#define CONNMAN_SERVICE "org.moblin.connman" +#define CONNMAN_SERVICE "net.connman" #define CONNMAN_ERROR_INTERFACE CONNMAN_SERVICE ".Error" #define CONNMAN_AGENT_INTERFACE CONNMAN_SERVICE ".Agent" @@ -32,9 +32,6 @@ #define CONNMAN_PROFILE_INTERFACE CONNMAN_SERVICE ".Profile" #define CONNMAN_SERVICE_INTERFACE CONNMAN_SERVICE ".Service" -#define CONNMAN_DEVICE_INTERFACE CONNMAN_SERVICE ".Device" -#define CONNMAN_NETWORK_INTERFACE CONNMAN_SERVICE ".Network" -#define CONNMAN_CONNECTION_INTERFACE CONNMAN_SERVICE ".Connection" DBusGProxy *connman_dbus_create_manager(DBusGConnection *connection, GtkTreeStore *store); diff --git a/common/instance.c b/common/instance.c index 8934cd5..166979e 100644 --- a/common/instance.c +++ b/common/instance.c @@ -29,7 +29,7 @@ #include "instance.h" -#define CONNMAN_SERVICE "org.moblin.connman" +#define CONNMAN_SERVICE "net.connman" #define CONNMAN_INSTANCE CONNMAN_SERVICE ".Instance" static DBusGConnection *connection; diff --git a/common/instance.xml b/common/instance.xml index d31fe2e..096579d 100644 --- a/common/instance.xml +++ b/common/instance.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <node name="/"> - <interface name="org.moblin.connman.Instance"> + <interface name="net.connman.Instance"> <method name="Present"> </method> </interface> diff --git a/common/test-config.c b/common/test-config.c index b8f6786..0c23337 100644 --- a/common/test-config.c +++ b/common/test-config.c @@ -143,7 +143,7 @@ static DBusGProxy *manager; static void name_owner_changed(DBusGProxy *dbus, const char *name, const char *prev, const char *new, gpointer user_data) { - if (g_str_equal(name, "org.moblin.connman") == FALSE) + if (g_str_equal(name, "net.connman") == FALSE) return; if (*new != '\0') { @@ -284,8 +284,8 @@ int main(int argc, char *argv[]) proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); - manager = dbus_g_proxy_new_for_name(connection, "org.moblin.connman", - "/", "org.moblin.connman.Manager"); + manager = dbus_g_proxy_new_for_name(connection, "net.connman", + "/", "net.connman.Manager"); create_window(); diff --git a/common/test-dbus.c b/common/test-dbus.c index 0b7cebd..867a648 100644 --- a/common/test-dbus.c +++ b/common/test-dbus.c @@ -78,7 +78,7 @@ static void get_properties(const char *path, const char *interface) { DBusGProxy *proxy; - proxy = dbus_g_proxy_new_for_name(connection, "org.moblin.connman", + proxy = dbus_g_proxy_new_for_name(connection, "net.connman", path, interface); if (dbus_g_proxy_begin_call_with_timeout(proxy, "GetProperties", @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) g_error_free(error); } - get_properties("/", "org.moblin.connman.Manager"); + get_properties("/", "net.connman.Manager"); g_main_loop_run(mainloop); -- 1.7.1 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman