From: Marcel Holtmann Date: Sat, 20 Dec 2008 07:57:15 +0000 (+0100) Subject: Use connman_dbus_dict_append_variant() instead of self-coded version X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4387 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95fdd0345e76d6670787dad454265d3affdb52b9;p=profile%2Fivi%2Fconnman.git Use connman_dbus_dict_append_variant() instead of self-coded version --- diff --git a/src/profile.c b/src/profile.c index 057ece7..8690770 100644 --- a/src/profile.c +++ b/src/profile.c @@ -37,23 +37,6 @@ void __connman_profile_list(DBusMessageIter *iter) dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); } -static void append_string(DBusMessageIter *dict, const char *key, void *val) -{ - DBusMessageIter entry, value; - - dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, - NULL, &entry); - - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key); - - dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT, - DBUS_TYPE_STRING_AS_STRING, &value); - dbus_message_iter_append_basic(&value, DBUS_TYPE_STRING, val); - dbus_message_iter_close_container(&entry, &value); - - dbus_message_iter_close_container(dict, &entry); -} - static DBusMessage *get_properties(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -74,7 +57,8 @@ static DBusMessage *get_properties(DBusConnection *conn, DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - append_string(&dict, "Name", &name); + connman_dbus_dict_append_variant(&dict, "Name", + DBUS_TYPE_STRING, &name); dbus_message_iter_close_container(&array, &dict);