aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-03-30 16:04:30 -0500
committerTed Gould <ted@gould.cx>2012-03-30 16:04:30 -0500
commite1e8d32c77993e0ebddaeee4064c7b94d852246c (patch)
treef051376c45855d4be6a16b4e227aafb4bdd8f4e2
parentea39b9a3af989d4b6913b34245c97c85b652b11b (diff)
downloadlibdbusmenu-e1e8d32c77993e0ebddaeee4064c7b94d852246c.tar.gz
libdbusmenu-e1e8d32c77993e0ebddaeee4064c7b94d852246c.tar.bz2
libdbusmenu-e1e8d32c77993e0ebddaeee4064c7b94d852246c.zip
Checking the version of the server to see if we can group the properties
-rw-r--r--libdbusmenu-glib/client.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 5cf9d18..2d07f0c 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1147,6 +1147,25 @@ menuproxy_build_cb (GObject * object, GAsyncResult * res, gpointer user_data)
g_variant_unref(icon_dirs);
}
+ /* Get the icon theme directories if available */
+ GVariant * version = g_dbus_proxy_get_cached_property(priv->menuproxy, "Version");
+ if (version != NULL) {
+ guint32 remote_version = 0;
+
+ if (g_variant_is_of_type(version, G_VARIANT_TYPE_UINT32)) {
+ remote_version = g_variant_get_uint32(version);
+ }
+
+ if (remote_version >= 3) {
+ priv->group_events = TRUE;
+ } else {
+ priv->group_events = FALSE;
+ }
+
+ g_variant_unref(version);
+ version = NULL;
+ }
+
/* If we get here, we don't need the DBus proxy */
if (priv->dbusproxy != 0) {
g_bus_unwatch_name(priv->dbusproxy);
@@ -1226,6 +1245,19 @@ menuproxy_prop_changed_cb (GDBusProxy * proxy, GVariant * properties, GStrv inva
priv->icon_dirs = g_variant_dup_strv(value, NULL);
dirs_changed = TRUE;
}
+ if (g_strcmp0(key, "Version") == 0) {
+ guint32 remote_version = 0;
+
+ if (g_variant_is_of_type(value, G_VARIANT_TYPE_UINT32)) {
+ remote_version = g_variant_get_uint32(value);
+ }
+
+ if (remote_version >= 3) {
+ priv->group_events = TRUE;
+ } else {
+ priv->group_events = FALSE;
+ }
+ }
}
if (olddir != priv->text_direction) {