From 102df1da56cf6bdec1c67682da7858c35a3ae5ab Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 16 Oct 2008 21:23:43 +0300 Subject: Fix remaining places to use dict_append_entry too --- audio/control.c | 3 +-- audio/headset.c | 16 ++++++---------- audio/sink.c | 6 ++---- network/connection.c | 9 +++------ network/server.c | 9 +++------ serial/proxy.c | 19 +++++++------------ 6 files changed, 22 insertions(+), 40 deletions(-) diff --git a/audio/control.c b/audio/control.c index 3e4e776a..849af932 100644 --- a/audio/control.c +++ b/audio/control.c @@ -998,8 +998,7 @@ static DBusMessage *control_get_properties(DBusConnection *conn, /* Connected */ value = (device->control->session != NULL); - dbus_message_iter_append_dict_entry(&dict, "Connected", - DBUS_TYPE_BOOLEAN, &value); + dict_append_entry(&dict, "Connected", DBUS_TYPE_BOOLEAN, &value); dbus_message_iter_close_container(&iter, &dict); diff --git a/audio/headset.c b/audio/headset.c index 44b1f801..5f6f00f0 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -1746,26 +1746,22 @@ static DBusMessage *hs_get_properties(DBusConnection *conn, /* Playing */ value = (device->headset->state == HEADSET_STATE_PLAYING); - dbus_message_iter_append_dict_entry(&dict, "Playing", - DBUS_TYPE_BOOLEAN, &value); + dict_append_entry(&dict, "Playing", DBUS_TYPE_BOOLEAN, &value); /* Connected */ value = (device->headset->state >= HEADSET_STATE_CONNECTED); - dbus_message_iter_append_dict_entry(&dict, "Connected", - DBUS_TYPE_BOOLEAN, &value); + dict_append_entry(&dict, "Connected", DBUS_TYPE_BOOLEAN, &value); if (!value) goto done; /* SpeakerGain */ - dbus_message_iter_append_dict_entry(&dict, "SpeakerGain", - DBUS_TYPE_UINT16, - &device->headset->sp_gain); + dict_append_entry(&dict, "SpeakerGain", + DBUS_TYPE_UINT16, &device->headset->sp_gain); /* MicrophoneGain */ - dbus_message_iter_append_dict_entry(&dict, "MicrophoneGain", - DBUS_TYPE_UINT16, - &device->headset->mic_gain); + dict_append_entry(&dict, "MicrophoneGain", + DBUS_TYPE_UINT16, &device->headset->mic_gain); done: dbus_message_iter_close_container(&iter, &dict); diff --git a/audio/sink.c b/audio/sink.c index 0d273e93..a1034c1a 100644 --- a/audio/sink.c +++ b/audio/sink.c @@ -532,13 +532,11 @@ static DBusMessage *sink_get_properties(DBusConnection *conn, /* Playing */ value = (device->sink->state == AVDTP_STATE_STREAMING); - dbus_message_iter_append_dict_entry(&dict, "Playing", - DBUS_TYPE_BOOLEAN, &value); + dict_append_entry(&dict, "Playing", DBUS_TYPE_BOOLEAN, &value); /* Connected */ value = (device->sink->state >= AVDTP_STATE_CONFIGURED); - dbus_message_iter_append_dict_entry(&dict, "Connected", - DBUS_TYPE_BOOLEAN, &value); + dict_append_entry(&dict, "Connected", DBUS_TYPE_BOOLEAN, &value); dbus_message_iter_close_container(&iter, &dict); diff --git a/network/connection.c b/network/connection.c index 08766db4..6d6ddd03 100644 --- a/network/connection.c +++ b/network/connection.c @@ -476,18 +476,15 @@ static DBusMessage *connection_get_properties(DBusConnection *conn, } connected = nc ? TRUE : FALSE; - dbus_message_iter_append_dict_entry(&dict, "Connected", - DBUS_TYPE_BOOLEAN, &connected); + dict_append_entry(&dict, "Connected", DBUS_TYPE_BOOLEAN, &connected); /* Device */ property = nc ? nc->dev : ""; - dbus_message_iter_append_dict_entry(&dict, "Device", - DBUS_TYPE_STRING, &property); + dict_append_entry(&dict, "Device", DBUS_TYPE_STRING, &property); /* UUID */ property = nc ? bnep_uuid(nc->id) : ""; - dbus_message_iter_append_dict_entry(&dict, "UUID", - DBUS_TYPE_STRING, &property); + dict_append_entry(&dict, "UUID", DBUS_TYPE_STRING, &property); dbus_message_iter_close_container(&iter, &dict); diff --git a/network/server.c b/network/server.c index 3230fde6..c37fd883 100644 --- a/network/server.c +++ b/network/server.c @@ -736,15 +736,12 @@ static DBusMessage *get_properties(DBusConnection *conn, DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - dbus_message_iter_append_dict_entry(&dict, "Name", - DBUS_TYPE_STRING, &ns->name); + dict_append_entry(&dict, "Name", DBUS_TYPE_STRING, &ns->name); uuid = bnep_uuid(ns->id); - dbus_message_iter_append_dict_entry(&dict, "Uuid", - DBUS_TYPE_STRING, &uuid); + dict_append_entry(&dict, "Uuid", DBUS_TYPE_STRING, &uuid); - dbus_message_iter_append_dict_entry(&dict, "Enabled", - DBUS_TYPE_BOOLEAN, &ns->enable); + dict_append_entry(&dict, "Enabled", DBUS_TYPE_BOOLEAN, &ns->enable); dbus_message_iter_close_container(&iter, &dict); diff --git a/serial/proxy.c b/serial/proxy.c index 643e19aa..8667da81 100644 --- a/serial/proxy.c +++ b/serial/proxy.c @@ -503,23 +503,19 @@ static DBusMessage *proxy_get_info(DBusConnection *conn, DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - dbus_message_iter_append_dict_entry(&dict, "uuid", - DBUS_TYPE_STRING, &prx->uuid128); + dict_append_entry(&dict, "uuid", DBUS_TYPE_STRING, &prx->uuid128); - dbus_message_iter_append_dict_entry(&dict, "address", - DBUS_TYPE_STRING, &prx->address); + dict_append_entry(&dict, "address", DBUS_TYPE_STRING, &prx->address); if (prx->channel) - dbus_message_iter_append_dict_entry(&dict, "channel", - DBUS_TYPE_BYTE, &prx->channel); + dict_append_entry(&dict, "channel", + DBUS_TYPE_BYTE, &prx->channel); boolean = (prx->io ? TRUE : FALSE); - dbus_message_iter_append_dict_entry(&dict, "enabled", - DBUS_TYPE_BOOLEAN, &boolean); + dict_append_entry(&dict, "enabled", DBUS_TYPE_BOOLEAN, &boolean); boolean = (prx->rfcomm_watch ? TRUE : FALSE); - dbus_message_iter_append_dict_entry(&dict, "connected", - DBUS_TYPE_BOOLEAN, &boolean); + dict_append_entry(&dict, "connected", DBUS_TYPE_BOOLEAN, &boolean); /* If connected: append the remote address */ if (boolean) { @@ -527,8 +523,7 @@ static DBusMessage *proxy_get_info(DBusConnection *conn, const char *pstr = bda; ba2str(&prx->dst, bda); - dbus_message_iter_append_dict_entry(&dict, "address", - DBUS_TYPE_STRING, &pstr); + dict_append_entry(&dict, "address", DBUS_TYPE_STRING, &pstr); } dbus_message_iter_close_container(&iter, &dict); -- cgit