aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-01 11:45:50 -0600
committerTed Gould <ted@gould.cx>2011-03-01 11:45:50 -0600
commite45f9a41dd7104152d462870d6ac8feb0f64c0b5 (patch)
treec436f743a19ac73c939c4f610c7b1b07c9ca3996 /libdbusmenu-gtk
parentf9bc2ad66bbd631b17d264cb1baddf600b67ed7c (diff)
downloadlibdbusmenu-e45f9a41dd7104152d462870d6ac8feb0f64c0b5.tar.gz
libdbusmenu-e45f9a41dd7104152d462870d6ac8feb0f64c0b5.tar.bz2
libdbusmenu-e45f9a41dd7104152d462870d6ac8feb0f64c0b5.zip
Move keyname check before builder is init'd
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/menuitem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c
index fd8246c..370dbf2 100644
--- a/libdbusmenu-gtk/menuitem.c
+++ b/libdbusmenu-gtk/menuitem.c
@@ -177,6 +177,9 @@ dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key,
g_return_val_if_fail(DBUSMENU_IS_MENUITEM(menuitem), FALSE);
g_return_val_if_fail(gtk_accelerator_valid(key, modifier), FALSE);
+ const gchar * keyname = gdk_keyval_name(key);
+ g_return_val_if_fail(keyname != NULL, FALSE);
+
GVariantBuilder builder;
g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
@@ -193,8 +196,6 @@ dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key,
g_variant_builder_add(&builder, "s", DBUSMENU_MENUITEM_SHORTCUT_SUPER);
}
- const gchar * keyname = gdk_keyval_name(key);
- g_return_val_if_fail(keyname != NULL, FALSE);
g_variant_builder_add(&builder, "s", keyname);
GVariant * inside = g_variant_builder_end(&builder);