From 9c40d3b5ba6d5e02ee4a52a571e149a2869662b6 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 5 Dec 2009 23:45:53 +0100 Subject: [PATCH] Handle Empty menu item in bookmarks and not in KatzeArrayAction --- katze/katze-arrayaction.c | 11 ++--------- midori/midori-browser.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/katze/katze-arrayaction.c b/katze/katze-arrayaction.c index ea5ac819..9f7b1520 100644 --- a/katze/katze-arrayaction.c +++ b/katze/katze-arrayaction.c @@ -301,8 +301,8 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action, GtkWidget* menu, GtkWidget* proxy) { - guint i; - guint summand; + gint i; + gint summand; KatzeItem* item; GtkWidget* menuitem; const gchar* icon_name; @@ -368,13 +368,6 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action, } gtk_widget_show (menuitem); } - if (!i) - { - menuitem = gtk_image_menu_item_new_with_label (_("Empty")); - gtk_widget_set_sensitive (menuitem, FALSE); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); - gtk_widget_show (menuitem); - } } static void diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 0fda96ba..88d204af 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2844,10 +2844,15 @@ _action_bookmarks_populate_popup (GtkAction* action, } g_list_free (children); - if (katze_array_get_nth_item (browser->bookmarks, 0)) + menuitem = gtk_separator_menu_item_new (); + gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); + gtk_widget_show (menuitem); + + if (katze_array_is_empty (browser->bookmarks)) { - menuitem = gtk_separator_menu_item_new (); - gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); + menuitem = gtk_image_menu_item_new_with_label (_("Empty")); + gtk_widget_set_sensitive (menuitem, FALSE); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); } menuitem = gtk_action_create_menu_item ( -- 2.39.5