From: Christian Dywan Date: Sat, 5 Dec 2009 22:45:53 +0000 (+0100) Subject: Handle Empty menu item in bookmarks and not in KatzeArrayAction X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c40d3b5ba6d5e02ee4a52a571e149a2869662b6;p=midori Handle Empty menu item in bookmarks and not in KatzeArrayAction --- 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 (