[Xfce4-commits] <midori:master> Handle Empty menu item in bookmarks and not in KatzeArrayAction

Christian Dywan noreply at xfce.org
Sun Dec 6 00:02:02 CET 2009


Updating branch refs/heads/master
         to 9c40d3b5ba6d5e02ee4a52a571e149a2869662b6 (commit)
       from ca6174ba6c39b69d03bf1aa1802487125107d7b4 (commit)

commit 9c40d3b5ba6d5e02ee4a52a571e149a2869662b6
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Dec 5 23:45:53 2009 +0100

    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 ea5ac81..9f7b152 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 0fda96b..88d204a 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 (



More information about the Xfce4-commits mailing list