aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-22 14:56:43 -0500
committerTed Gould <ted@gould.cx>2011-03-22 14:56:43 -0500
commit2d7468b310a156e51cae228cc0b33030690e87c8 (patch)
treec677798f45563e1473bc56206534c11c8d2673eb
parent7a250968365a7d840ea30f48f9cc8dc016f1481e (diff)
parent8bab6b9d433d5cfd0d03c303e9d3e6bdc14a035d (diff)
downloadlibdbusmenu-2d7468b310a156e51cae228cc0b33030690e87c8.tar.gz
libdbusmenu-2d7468b310a156e51cae228cc0b33030690e87c8.tar.bz2
libdbusmenu-2d7468b310a156e51cae228cc0b33030690e87c8.zip
* Upstream Merge
* Protecting properties that are getting updated from an extra remove signal. (LP: #730925)
-rw-r--r--debian/changelog8
-rw-r--r--libdbusmenu-glib/client.c19
2 files changed, 27 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 191f077..d8e254f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+libdbusmenu (0.3.102-0ubuntu2~ppa2) UNRELEASED; urgency=low
+
+ * Upstream Merge
+ * Protecting properties that are getting updated from an
+ extra remove signal. (LP: #730925)
+
+ -- Ted Gould <ted@ubuntu.com> Tue, 22 Mar 2011 14:56:01 -0500
+
libdbusmenu (0.3.102-0ubuntu2~ppa1) natty; urgency=low
* Upstream Merge
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 2976436..018508c 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1368,9 +1368,28 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin
have_error = TRUE;
}
+ /* Get the list of the current properties */
GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
GList * tmp = NULL;
+ GVariantIter iter;
+ g_variant_iter_init(&iter, properties);
+ gchar * name; GVariant * value;
+
+ /* Remove the entries from the current list that we have new
+ values for. This way we don't create signals of them being
+ removed with the duplication of the value being changed. */
+ while (g_variant_iter_loop(&iter, "{sv}", &name, &value) && have_error == FALSE) {
+ for (tmp = current_props; tmp != NULL; tmp = g_list_next(tmp)) {
+ if (g_strcmp0((gchar *)tmp->data, name) == 0) {
+ current_props = g_list_remove(current_props, tmp);
+ break;
+ }
+ }
+ }
+
+ /* Remove all entries that we're not getting values for, we can
+ assume that they no longer exist */
for (tmp = current_props; tmp != NULL && have_error == FALSE; tmp = g_list_next(tmp)) {
dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)tmp->data);
}