diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-21 09:34:42 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-21 09:34:42 -0500 |
commit | 49f2313945ef095cc35b905eb7fe809477c9b290 (patch) | |
tree | dcba22a23c37261b16835d16d4fa1b940c87980f /libdbusmenu-gtk/client.c | |
parent | 4801af0799f19a2921650cb7086c46bfeaf271b1 (diff) | |
parent | be73acbfefefb4581f82b19421fe5fc39941901e (diff) | |
download | libdbusmenu-49f2313945ef095cc35b905eb7fe809477c9b290.tar.gz libdbusmenu-49f2313945ef095cc35b905eb7fe809477c9b290.tar.bz2 libdbusmenu-49f2313945ef095cc35b905eb7fe809477c9b290.zip |
merge lp:~charlesk/dbusmenu/lp-953509 to fix a crash in dbusmenu-gtk's handling of menu icon theme changes
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r-- | libdbusmenu-gtk/client.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 9cb1144..f507a56 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -738,24 +738,27 @@ process_a11y_desc (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, if (variant != NULL) { const gchar * setname = NULL; - setname = g_variant_dup_string(variant, NULL); + setname = g_variant_get_string(variant, NULL); atk_object_set_name(aobj, setname); } else { /* The atk docs advise to set the name of the atk object to an empty * string, but GTK doesn't yet do the same, and setting the name to NULL * causes tests to fail. */ - gchar * setname = NULL; const gchar * label = NULL; - /* We don't want the underscore for mnewmonics */ label = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL); - GRegex * regex = g_regex_new ("_", 0, 0, NULL); - setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL); - g_regex_unref(regex); + if (label != NULL) { + gchar * setname = NULL; - atk_object_set_name(aobj, setname); - g_free(setname); + /* We don't want the underscore for mnewmonics */ + GRegex * regex = g_regex_new ("_", 0, 0, NULL); + setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL); + g_regex_unref(regex); + + atk_object_set_name(aobj, setname); + g_free(setname); + } } return; |