diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-02-27 14:00:23 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-04-08 20:09:06 -0700 |
commit | e93f38881ed8629e89cf3412695c304e777e2aea (patch) | |
tree | 2af4c41e54d1d7399305d86cef98733fee89195d /gdbus | |
parent | befbfd1d15c4905b6f68d40b1fd68acc0fec231c (diff) | |
download | connman-e93f38881ed8629e89cf3412695c304e777e2aea.tar.gz connman-e93f38881ed8629e89cf3412695c304e777e2aea.tar.bz2 connman-e93f38881ed8629e89cf3412695c304e777e2aea.zip |
gdbus: Fix not calling property_changed callback
In case a property did not appear by the time proxy_added was called
property_changed has to be called if it appear latter otherwise the
application will be unaware of it.
Diffstat (limited to 'gdbus')
-rw-r--r-- | gdbus/client.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/gdbus/client.c b/gdbus/client.c index 1998fc8d..c2d23462 100644 --- a/gdbus/client.c +++ b/gdbus/client.c @@ -205,6 +205,7 @@ static void prop_entry_free(gpointer data) static void add_property(GDBusProxy *proxy, const char *name, DBusMessageIter *iter, gboolean send_changed) { + GDBusClient *client = proxy->client; DBusMessageIter value; struct prop_entry *prop; @@ -215,20 +216,8 @@ static void add_property(GDBusProxy *proxy, const char *name, prop = g_hash_table_lookup(proxy->prop_list, name); if (prop != NULL) { - GDBusClient *client = proxy->client; - prop_entry_update(prop, &value); - - if (proxy->prop_func) - proxy->prop_func(proxy, name, &value, proxy->prop_data); - - if (client == NULL || send_changed == FALSE) - return; - - if (client->property_changed) - client->property_changed(proxy, name, &value, - client->user_data); - return; + goto done; } prop = prop_entry_new(name, &value); @@ -237,8 +226,16 @@ static void add_property(GDBusProxy *proxy, const char *name, g_hash_table_replace(proxy->prop_list, prop->name, prop); +done: if (proxy->prop_func) proxy->prop_func(proxy, name, &value, proxy->prop_data); + + if (client == NULL || send_changed == FALSE) + return; + + if (client->property_changed) + client->property_changed(proxy, name, &value, + client->user_data); } static void update_properties(GDBusProxy *proxy, DBusMessageIter *iter, |