mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
builder: Show warning for invalid action on GtkShortcut
The parsing for a `GTK_TYPE_SHORTCUT_ACTION` on a GtkShortcut in a builder file can fail, resulting in a `NULL` GtkShortcutAction. This currently does not result in any warnings, potentially making typos in builder files tricky to debug. Since `gtk_shortcut_action_parse_builder()` already sets an error if it fails, we can just use that and simply return false.
This commit is contained in:
parent
f36f1b9829
commit
c0b813940e
@ -2695,8 +2695,10 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
|
||||
{
|
||||
GtkShortcutAction *action = gtk_shortcut_action_parse_builder (builder, string, error);
|
||||
|
||||
/* Works for success and failure (NULL) case */
|
||||
g_value_take_object (value, action);
|
||||
if (action)
|
||||
g_value_take_object (value, action);
|
||||
else
|
||||
ret = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user