[Xfce4-commits] [xfce/libxfce4ui] 01/01: Usage of g_warning instead of g_error on unknown action_id in 'xfce_gtk_get_action_entry_by_id'
noreply at xfce.org
noreply at xfce.org
Thu Mar 26 10:50:54 CET 2020
This is an automated email from the git hooks/post-receive script.
a l e x p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/libxfce4ui.
commit 6742bd77c282358df7217df969420649c8fbf304
Author: Alexander Schwinn <alexxcons at xfce.org>
Date: Thu Mar 26 10:49:48 2020 +0100
Usage of g_warning instead of g_error on unknown action_id in
'xfce_gtk_get_action_entry_by_id'
---
libxfce4ui/xfce-gtk-extensions.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libxfce4ui/xfce-gtk-extensions.c b/libxfce4ui/xfce-gtk-extensions.c
index 0cd6a55..83a4f33 100644
--- a/libxfce4ui/xfce-gtk-extensions.c
+++ b/libxfce4ui/xfce-gtk-extensions.c
@@ -287,6 +287,8 @@ xfce_gtk_menu_item_new_from_action_entry (const XfceGtkActionEntry *action_entry
GObject *callback_param,
GtkMenuShell *menu_to_append_item)
{
+ g_return_val_if_fail (action_entry != NULL, NULL);
+
if (action_entry->menu_item_type == XFCE_GTK_IMAGE_MENU_ITEM)
{
return xfce_gtk_image_menu_item_new_from_icon_name (action_entry->menu_item_label_text, action_entry->menu_item_tooltip_text,
@@ -323,6 +325,8 @@ xfce_gtk_toggle_menu_item_new_from_action_entry (const XfceGtkActionEntry *actio
gboolean active,
GtkMenuShell *menu_to_append_item)
{
+ g_return_val_if_fail (action_entry != NULL, NULL);
+
if (action_entry->menu_item_type == XFCE_GTK_CHECK_MENU_ITEM)
{
return xfce_gtk_check_menu_item_new (action_entry->menu_item_label_text, action_entry->menu_item_tooltip_text,
@@ -361,6 +365,8 @@ xfce_gtk_tool_button_new_from_action_entry (const XfceGtkActionEntry *action_ent
GtkToolItem *tool_item;
GtkWidget *image;
+ g_return_val_if_fail (action_entry != NULL, NULL);
+
image = gtk_image_new_from_icon_name (action_entry->menu_item_icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR);
tool_item = gtk_tool_button_new (image, action_entry->menu_item_label_text);
g_signal_connect_swapped (G_OBJECT (tool_item), "clicked", action_entry->callback, callback_param);
@@ -464,7 +470,7 @@ xfce_gtk_get_action_entry_by_id (const XfceGtkActionEntry *action_entries,
if( action_entries[i].id == id )
return &(action_entries[i]);
}
- g_error ("There is no action with the id '%i'.", id);
+ g_warning ("There is no action with the id '%i'.", id);
return NULL;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list