summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-24 18:04:12 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-24 18:04:12 +0000
commit769c4b021665a26c9a6c20457ef9b7ded54c8ad6 (patch)
tree61971f355a2a9fd823df492f193efc222702ae75 /common
parent30b429c3852bb036dc473b3ff11a278df443026d (diff)
Fix dbus_message_iter_append_variant to use dbus string array format (char **) instead GSList.
Diffstat (limited to 'common')
-rw-r--r--common/dbus-helper.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/dbus-helper.c b/common/dbus-helper.c
index 6c7946a8..e6211824 100644
--- a/common/dbus-helper.c
+++ b/common/dbus-helper.c
@@ -415,11 +415,6 @@ dbus_bool_t dbus_connection_unregister_interface(DBusConnection *connection,
return TRUE;
}
-static void append_array_item_string(const char *val, DBusMessageIter *iter)
-{
- dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &val);
-}
-
void dbus_message_iter_append_variant(DBusMessageIter *iter, int type, void *val)
{
DBusMessageIter value;
@@ -459,10 +454,15 @@ void dbus_message_iter_append_variant(DBusMessageIter *iter, int type, void *val
dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, sig, &value);
if (type == DBUS_TYPE_ARRAY) {
+ int i;
+ const char ***str_array = val;
+
dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
DBUS_TYPE_STRING_AS_STRING, &array);
- g_slist_foreach((GSList*) val, (GFunc) append_array_item_string,
- &array);
+
+ for (i = 0; (*str_array)[i]; i++)
+ dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING,
+ &((*str_array)[i]));
dbus_message_iter_close_container(&value, &array);
} else