aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-03-08 09:58:14 -0600
committerTed Gould <ted@gould.cx>2012-03-08 09:58:14 -0600
commit2ca22ea68d9bad535a42b7d40d027c8763e5ac44 (patch)
treeb0c4f2cb476f0757078b2f31e21b7ffcf1b049bd /libdbusmenu-glib
parent8dc3a0013a6fd0d8ab54edf0944f842da751c4e7 (diff)
parent1f223542ce9a8ae00d17928bd91e244793a76c24 (diff)
downloadlibdbusmenu-2ca22ea68d9bad535a42b7d40d027c8763e5ac44.tar.gz
libdbusmenu-2ca22ea68d9bad535a42b7d40d027c8763e5ac44.tar.bz2
libdbusmenu-2ca22ea68d9bad535a42b7d40d027c8763e5ac44.zip
Import upstream version 0.5.93
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/Makefile.in6
-rw-r--r--libdbusmenu-glib/client.c86
-rw-r--r--libdbusmenu-glib/menuitem.c6
3 files changed, 53 insertions, 45 deletions
diff --git a/libdbusmenu-glib/Makefile.in b/libdbusmenu-glib/Makefile.in
index d3c2f06..de06a31 100644
--- a/libdbusmenu-glib/Makefile.in
+++ b/libdbusmenu-glib/Makefile.in
@@ -222,6 +222,10 @@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@
+INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@
+INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@
+INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
@@ -314,6 +318,8 @@ htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
+intltool__v_merge_options_ = @intltool__v_merge_options_@
+intltool__v_merge_options_0 = @intltool__v_merge_options_0@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index e64d923..01f063d 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -601,64 +601,66 @@ get_properties_callback (GObject *obj, GAsyncResult * res, gpointer user_data)
listener->callback(NULL, error, listener->user_data);
}
g_error_free(error);
- goto out;
}
/* Callback all the folks we can find */
- GVariant * parent = g_variant_get_child_value(params, 0);
- GVariantIter iter;
- g_variant_iter_init(&iter, parent);
- GVariant * child;
- while ((child = g_variant_iter_next_value(&iter)) != NULL) {
- if (g_strcmp0(g_variant_get_type_string(child), "(ia{sv})") != 0) {
- g_warning("Properties return signature is not '(ia{sv})' it is '%s'", g_variant_get_type_string(child));
- g_variant_unref(child);
- continue;
- }
+ if (error == NULL) {
+ GVariant * parent = g_variant_get_child_value(params, 0);
+ GVariantIter iter;
+ g_variant_iter_init(&iter, parent);
+ GVariant * child;
+ while ((child = g_variant_iter_next_value(&iter)) != NULL) {
+ if (g_strcmp0(g_variant_get_type_string(child), "(ia{sv})") != 0) {
+ g_warning("Properties return signature is not '(ia{sv})' it is '%s'", g_variant_get_type_string(child));
+ g_variant_unref(child);
+ continue;
+ }
- GVariant * idv = g_variant_get_child_value(child, 0);
- gint id = g_variant_get_int32(idv);
- g_variant_unref(idv);
+ GVariant * idv = g_variant_get_child_value(child, 0);
+ gint id = g_variant_get_int32(idv);
+ g_variant_unref(idv);
+
+ GVariant * properties = g_variant_get_child_value(child, 1);
- GVariant * properties = g_variant_get_child_value(child, 1);
+ properties_listener_t * listener = find_listener(listeners, 0, id);
+ if (listener == NULL) {
+ g_warning("Unable to find listener for ID %d", id);
+ g_variant_unref(properties);
+ g_variant_unref(child);
+ continue;
+ }
- properties_listener_t * listener = find_listener(listeners, 0, id);
- if (listener == NULL) {
- g_warning("Unable to find listener for ID %d", id);
+ if (!listener->replied) {
+ listener->callback(properties, NULL, listener->user_data);
+ listener->replied = TRUE;
+ } else {
+ g_warning("Odd, we've already replied to the listener on ID %d", id);
+ }
g_variant_unref(properties);
g_variant_unref(child);
- continue;
}
-
- if (!listener->replied) {
- listener->callback(properties, NULL, listener->user_data);
- listener->replied = TRUE;
- } else {
- g_warning("Odd, we've already replied to the listener on ID %d", id);
- }
- g_variant_unref(properties);
- g_variant_unref(child);
+ g_variant_unref(parent);
+ g_variant_unref(params);
}
- g_variant_unref(parent);
- g_variant_unref(params);
/* Provide errors for those who we can't */
- GError * localerror = NULL;
- for (i = 0; i < listeners->len; i++) {
- properties_listener_t * listener = &g_array_index(listeners, properties_listener_t, i);
- if (!listener->replied) {
- g_warning("Generating properties error for: %d", listener->id);
- if (localerror == NULL) {
- g_set_error_literal(&localerror, error_domain(), 0, "Error getting properties for ID");
+ if (error == NULL && listeners->len > 0) {
+ GError * localerror = NULL;
+ for (i = 0; i < listeners->len; i++) {
+ properties_listener_t * listener = &g_array_index(listeners, properties_listener_t, i);
+ if (!listener->replied) {
+ g_warning("Generating properties error for: %d", listener->id);
+ if (localerror == NULL) {
+ g_set_error_literal(&localerror, error_domain(), 0, "Error getting properties for ID");
+ }
+ listener->callback(NULL, localerror, listener->user_data);
}
- listener->callback(NULL, localerror, listener->user_data);
}
- }
- if (localerror != NULL) {
- g_error_free(localerror);
+ if (localerror != NULL) {
+ g_error_free(localerror);
+ }
}
-out:
/* Clean up */
g_array_free(listeners, TRUE);
g_object_unref(cbdata->client);
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 18db4ef..c81c36e 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -1253,7 +1253,7 @@ dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * pro
becuse it has been unref'd when replaced in the hash
table. But the fact that there was a value is
the imporant part. */
- if (!inhash || replaced) {
+ if (replaced) {
GVariant * signalval = value;
if (signalval == NULL) {
@@ -1462,8 +1462,8 @@ dbusmenu_menuitem_property_remove (DbusmenuMenuitem * mi, const gchar * property
* by the menuitem but the list is not and should be freed using
* g_list_free() when the calling function is done with it.
*
- * Return value: (transfer container): A list of strings or NULL if there are
- * none.
+ * Return value: (transfer container) (element-type utf8): A list of
+ * strings or NULL if there are none.
*/
GList *
dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi)