Use the network list from the hash table
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 8 Mar 2009 16:28:35 +0000 (17:28 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 8 Mar 2009 16:28:35 +0000 (17:28 +0100)
src/device.c

index 4302646238e0d99856214a247d03698a49bf70a9..a354fe23146dfc98f44b158969800ecc4c50111f 100644 (file)
@@ -237,6 +237,15 @@ static int set_policy(DBusConnection *connection,
        return 0;
 }
 
+static void append_path(gpointer key, gpointer value, gpointer user_data)
+{
+       struct connman_element *element = value;
+       DBusMessageIter *iter = user_data;
+
+       dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH,
+                                                       &element->path);
+}
+
 static void append_networks(struct connman_device *device,
                                                DBusMessageIter *entry)
 {
@@ -251,8 +260,7 @@ static void append_networks(struct connman_device *device,
 
        dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
                                DBUS_TYPE_OBJECT_PATH_AS_STRING, &iter);
-       __connman_element_list((struct connman_element *) device,
-                                       CONNMAN_ELEMENT_TYPE_NETWORK, &iter);
+       g_hash_table_foreach(device->networks, append_path, &iter);
        dbus_message_iter_close_container(&value, &iter);
 
        dbus_message_iter_close_container(entry, &value);