Fix the swapped registered vs enabled technologies signal
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 19 Jul 2009 19:05:40 +0000 (21:05 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 19 Jul 2009 19:05:40 +0000 (21:05 +0200)
src/notifier.c

index 822cd5c..3ae9a0c 100644 (file)
@@ -144,20 +144,19 @@ void __connman_notifier_list_connected(DBusMessageIter *iter)
        }
 }
 
-static void technology_enabled(enum connman_device_type type,
-                                               connman_bool_t enabled)
+static void technology_registered(enum connman_service_type type,
+                                               connman_bool_t registered)
 {
-       GSList *list;
        DBusMessage *signal;
        DBusMessageIter entry, value, iter;
-       const char *key = "EnabledTechnologies";
+       const char *key = "AvailableTechnologies";
 
-       DBG("type %d enabled %d", type, enabled);
+       DBG("type %d registered %d", type, registered);
 
        signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
                                CONNMAN_MANAGER_INTERFACE, "PropertyChanged");
        if (signal == NULL)
-               goto done;
+               return;
 
        dbus_message_iter_init_append(signal, &entry);
 
@@ -175,29 +174,22 @@ static void technology_enabled(enum connman_device_type type,
        dbus_message_iter_close_container(&entry, &value);
 
        g_dbus_send_message(connection, signal);
-
-done:
-       for (list = notifier_list; list; list = list->next) {
-               struct connman_notifier *notifier = list->data;
-
-               if (notifier->device_enabled)
-                       notifier->device_enabled(type, enabled);
-       }
 }
 
-static void technology_registered(enum connman_service_type type,
-                                               connman_bool_t registered)
+static void technology_enabled(enum connman_device_type type,
+                                               connman_bool_t enabled)
 {
+       GSList *list;
        DBusMessage *signal;
        DBusMessageIter entry, value, iter;
-       const char *key = "AvailableTechnologies";
+       const char *key = "EnabledTechnologies";
 
-       DBG("type %d registered %d", type, registered);
+       DBG("type %d enabled %d", type, enabled);
 
        signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
                                CONNMAN_MANAGER_INTERFACE, "PropertyChanged");
        if (signal == NULL)
-               return;
+               goto done;
 
        dbus_message_iter_init_append(signal, &entry);
 
@@ -215,6 +207,14 @@ static void technology_registered(enum connman_service_type type,
        dbus_message_iter_close_container(&entry, &value);
 
        g_dbus_send_message(connection, signal);
+
+done:
+       for (list = notifier_list; list; list = list->next) {
+               struct connman_notifier *notifier = list->data;
+
+               if (notifier->device_enabled)
+                       notifier->device_enabled(type, enabled);
+       }
 }
 
 static void technology_connected(enum connman_service_type type,