summaryrefslogtreecommitdiff
path: root/gio
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-05-13 16:57:29 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-05-13 16:57:29 -0400
commit3ca28ef718d402bd65cd9f291c67b299f1ef74cf (patch)
tree9560f10796e9f7a2406fed502707fdead8de5071 /gio
parente3f5d3c00595ca017d83015fa2b9832d1c87828f (diff)
GDBus: Update docs for GDBusProxy::g-properties-changed signal
Also update the example. See https://bugzilla.gnome.org/show_bug.cgi?id=618559 for more details. Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'gio')
-rw-r--r--gio/gdbusproxy.c10
-rw-r--r--gio/tests/gdbus-example-watch-proxy.c7
2 files changed, 10 insertions, 7 deletions
diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c
index bf0e2d197..07b7f8e31 100644
--- a/gio/gdbusproxy.c
+++ b/gio/gdbusproxy.c
@@ -387,13 +387,13 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
/**
* GDBusProxy::g-properties-changed:
* @proxy: The #GDBusProxy emitting the signal.
- * @changed_properties: A #GVariant containing the properties that
- * changed or %NULL if no properties changed.
- * @invalidated_properties: A %NULL terminated list of properties that was
- * invalidated or %NULL if no properties was invalidated.
+ * @changed_properties: A #GVariant containing the properties that changed
+ * @invalidated_properties: A %NULL terminated array of properties that was invalidated
*
* Emitted when one or more D-Bus properties on @proxy changes. The
- * local cache has already been updated when this signal fires.
+ * local cache has already been updated when this signal fires. Note
+ * that both @changed_properties and @invalidated_properties are
+ * guaranteed to never be %NULL (either may be empty though).
*
* This signal corresponds to the
* <literal>PropertiesChanged</literal> D-Bus signal on the
diff --git a/gio/tests/gdbus-example-watch-proxy.c b/gio/tests/gdbus-example-watch-proxy.c
index f4796eea8..972a66dec 100644
--- a/gio/tests/gdbus-example-watch-proxy.c
+++ b/gio/tests/gdbus-example-watch-proxy.c
@@ -47,8 +47,11 @@ on_properties_changed (GDBusProxy *proxy,
const gchar* const *invalidated_properties,
gpointer user_data)
{
+ /* Note that we are guaranteed that changed_properties and
+ * invalidated_properties are never NULL
+ */
- if (changed_properties != NULL)
+ if (g_variant_n_children (changed_properties) > 0)
{
GVariantIter *iter;
GVariant *item;
@@ -72,7 +75,7 @@ on_properties_changed (GDBusProxy *proxy,
}
}
- if (invalidated_properties != NULL)
+ if (g_strv_length ((GStrv) invalidated_properties) > 0)
{
guint n;
g_print (" *** Properties Invalidated:\n");