diff options
author | Ted Gould <ted@gould.cx> | 2012-03-21 14:25:55 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-03-21 14:25:55 -0500 |
commit | ebab055ed741101f59c320367eb8be7484555a48 (patch) | |
tree | 6002f164a459a7f149728c5bef71bfe94ccc1c82 /libdbusmenu-gtk/client.c | |
parent | 890165c74783d1771e0a391987630481885cbe4a (diff) | |
parent | 4dd014ca94bd0a47cece8fcc1cf978431adc2888 (diff) | |
download | libdbusmenu-ebab055ed741101f59c320367eb8be7484555a48.tar.gz libdbusmenu-ebab055ed741101f59c320367eb8be7484555a48.tar.bz2 libdbusmenu-ebab055ed741101f59c320367eb8be7484555a48.zip |
Import upstream version 0.5.95
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; |