[Galago-commits] r2326 - in trunk/libgalago: . libgalago
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Sat Nov 19 15:57:10 PST 2005
Author: chipx86
Date: 2005-11-19 15:57:08 -0800 (Sat, 19 Nov 2005)
New Revision: 2326
Modified:
trunk/libgalago/ChangeLog
trunk/libgalago/libgalago/galago-dbus.c
Log:
Support retrieving actual arrays of objects in galago_dbus_message_iter_get_object_list when the iter is an array. Otherwise, fall back on our hacked up one from the D-BUS 0.2x days, which will be removed in time.
Modified: trunk/libgalago/ChangeLog
===================================================================
--- trunk/libgalago/ChangeLog 2005-11-19 23:51:34 UTC (rev 2325)
+++ trunk/libgalago/ChangeLog 2005-11-19 23:57:08 UTC (rev 2326)
@@ -1,3 +1,11 @@
+Sat Nov 19 15:56:04 PST 2005 Christian Hammond <chipx86 at chipx86.com>
+
+ * libgalago/galago-dbus.c:
+ - Support retrieving actual arrays of objects in
+ galago_dbus_message_iter_get_object_list when the iter is an array.
+ Otherwise, fall back on our hacked up one from the D-BUS 0.2x days,
+ which will be removed in time.
+
Sat Nov 19 15:51:11 PST 2005 Christian Hammond <chipx86 at chipx86.com>
* libgalago/galago-account.c:
Modified: trunk/libgalago/libgalago/galago-dbus.c
===================================================================
--- trunk/libgalago/libgalago/galago-dbus.c 2005-11-19 23:51:34 UTC (rev 2325)
+++ trunk/libgalago/libgalago/galago-dbus.c 2005-11-19 23:57:08 UTC (rev 2326)
@@ -158,35 +158,37 @@
galago_dbus_message_iter_get_object_list(DBusMessageIter *iter, GType type)
{
GList *list = NULL;
-#if 0
- DBusMessageIter array_iter;
-#else
- dbus_uint32_t num_objects, i;
-#endif
g_return_val_if_fail(iter != NULL, NULL);
-#if 0
- dbus_message_iter_recurse(iter, &array_iter);
-
- while (dbus_message_iter_get_arg_type(&array_iter) == DBUS_TYPE_STRUCT)
+ if (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_ARRAY)
{
- list = g_list_append(list,
- galago_dbus_message_iter_get_object(&array_iter, klass));
+ DBusMessageIter array_iter;
+ dbus_message_iter_recurse(iter, &array_iter);
- dbus_message_iter_next(&array_iter);
+ while (dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_INVALID)
+ {
+ list = g_list_append(list,
+ galago_dbus_message_iter_get_object(&array_iter, type));
+
+ dbus_message_iter_next(&array_iter);
+ }
}
-#else
- dbus_message_iter_get_basic(iter, &num_objects);
-
- for (i = 0; i < num_objects; i++)
+ else
{
- dbus_message_iter_next(iter);
+ /* XXX Nuke this when everything moves to a common array format */
+ dbus_uint32_t num_objects, i;
- list = g_list_append(list,
- galago_dbus_message_iter_get_object(iter, type));
+ dbus_message_iter_get_basic(iter, &num_objects);
+
+ for (i = 0; i < num_objects; i++)
+ {
+ dbus_message_iter_next(iter);
+
+ list = g_list_append(list,
+ galago_dbus_message_iter_get_object(iter, type));
+ }
}
-#endif
return list;
}
More information about the galago-commits
mailing list