From: Ira W. Snyder Date: Tue, 29 Jan 2008 20:16:41 +0000 (-0800) Subject: [Keybinder] Add better validation X-Git-Url: https://irasnyder.com/gitweb/?a=commitdiff_plain;h=53670e813ec02739a1b5677e8454248a306888c3;p=tilda-gobject.git [Keybinder] Add better validation The GTK+ documentation for gtk_accelerator_parse() is incorrect, so use the gtk_accelerator_valid() function to check if accelerators are invalid instead of following the documentation. --- diff --git a/tomboykeybinder.c b/tomboykeybinder.c index d88daa3..f2854e9 100644 --- a/tomboykeybinder.c +++ b/tomboykeybinder.c @@ -96,7 +96,7 @@ do_grab_key (Binding *binding) gtk_accelerator_parse (binding->keystring, &keysym, &virtual_mods); - if (keysym == 0 && virtual_mods == 0) + if (!gtk_accelerator_valid(keysym, virtual_mods)) return FALSE; TRACE (g_print ("Got accel %d, %d\n", keysym, virtual_mods));