From 56c8f557430662f05d39c48674fed8a68bdab082 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 7 Jan 2013 16:18:09 +0100 Subject: [PATCH] account-addressing: fire PropertiesChanged on URISchemes change --- src/mcd-account-addressing.c | 9 +++++++++ tests/twisted/account/addressing.py | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/mcd-account-addressing.c b/src/mcd-account-addressing.c index d5604cb..36eacea 100644 --- a/src/mcd-account-addressing.c +++ b/src/mcd-account-addressing.c @@ -60,6 +60,7 @@ addressing_set_uri_scheme_association (TpSvcAccountInterfaceAddressing *iface, { GPtrArray *new_schemes = g_ptr_array_new (); gchar **s; + GHashTable *changed; if (association) { @@ -81,6 +82,14 @@ addressing_set_uri_scheme_association (TpSvcAccountInterfaceAddressing *iface, mcd_storage_set_strv (storage, account, SCHEMES, (const gchar * const *) new_schemes->pdata, FALSE); + changed = tp_asv_new ( + SCHEMES, G_TYPE_STRV, new_schemes->pdata, + NULL); + + tp_svc_dbus_properties_emit_properties_changed (self, + TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING, changed, NULL); + + g_hash_table_unref (changed); g_ptr_array_unref (new_schemes); } diff --git a/tests/twisted/account/addressing.py b/tests/twisted/account/addressing.py index 84faae9..1abe15f 100755 --- a/tests/twisted/account/addressing.py +++ b/tests/twisted/account/addressing.py @@ -52,6 +52,10 @@ def test(q, bus, mc): uri_schemes = get_schemes (account_props) assertEquals (uri_schemes, ['email']) + e = q.expect('dbus-signal', signal='PropertiesChanged') + assertEquals (e.args, [ cs.ACCOUNT_IFACE_ADDRESSING, + { cs.ACCOUNT_IFACE_ADDRESSING + '.URISchemes' : ['email'] }, [] ]) + # add association to list where it already resides address_iface.SetURISchemeAssociation ('email', True) uri_schemes = get_schemes (account_props) -- 1.8.0.1