[gnome-menus] gmenu-tree: Properly implement <OnlyUnallocated />



commit c5a85ac55d656870fc339fc448efc27e91b507dc
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Apr 30 01:43:51 2013 -0400

    gmenu-tree: Properly implement <OnlyUnallocated />
    
    The implementation here before was bad -- if two directories explicitly
    included some menu entry and had <OnlyUnallocated />, they'd both get the
    menu file, which is obviously wrong.
    
    Fix this so that if two directories have <OnlyUnallocated />, the first
    one in the menu file "wins", which as far as I can tell is the correct
    semantics.

 libmenu/gmenu-tree.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libmenu/gmenu-tree.c b/libmenu/gmenu-tree.c
index ac55eeb..80d5876 100644
--- a/libmenu/gmenu-tree.c
+++ b/libmenu/gmenu-tree.c
@@ -3605,8 +3605,7 @@ process_layout (GMenuTree          *tree,
 
   directory->only_unallocated = only_unallocated;
 
-  if (!directory->only_unallocated)
-    desktop_entry_set_union (allocated, entries);
+  desktop_entry_set_union (allocated, entries);
 
   if (directory->directory_entry)
     {
@@ -3732,7 +3731,8 @@ process_only_unallocated (GMenuTree          *tree,
           GMenuTreeEntry *entry = tmp->data;
           GSList         *next  = tmp->next;
 
-          if (desktop_entry_set_lookup (allocated, entry->desktop_file_id))
+          if (desktop_entry_set_lookup (allocated, entry->desktop_file_id) &&
+              desktop_entry_set_lookup (unallocated_used, entry->desktop_file_id))
             {
               directory->entries = g_slist_delete_link (directory->entries,
                                                         tmp);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]