[Xfce4-commits] <garcon:master> Sort cases in garcon_menu_node_tree_rule_matches().

Nick Schermer noreply at xfce.org
Sun Jun 26 09:20:03 CEST 2011


Updating branch refs/heads/master
         to ac66e7fbfc0788eb870ee773fc4420e432340370 (commit)
       from 42c7fdfde47a1f4ba79c70f28e9615cf7aee5164 (commit)

commit ac66e7fbfc0788eb870ee773fc4420e432340370
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Jun 26 08:59:44 2011 +0200

    Sort cases in garcon_menu_node_tree_rule_matches().
    
    Sort the most common node types to the top of the switch. With the
    stock menu the followint types were processed:
    
        772 GARCON_MENU_NODE_TYPE_INCLUDE
         30 GARCON_MENU_NODE_TYPE_EXCLUDE
          4 GARCON_MENU_NODE_TYPE_DIRECTORY_DIR
         73 GARCON_MENU_NODE_TYPE_FILENAME
       1142 GARCON_MENU_NODE_TYPE_CATEGORY
        158 GARCON_MENU_NODE_TYPE_OR

 garcon/garcon-menu-node.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/garcon/garcon-menu-node.c b/garcon/garcon-menu-node.c
index 6991eed..f7e8e0a 100644
--- a/garcon/garcon-menu-node.c
+++ b/garcon/garcon-menu-node.c
@@ -616,6 +616,10 @@ garcon_menu_node_tree_rule_matches (GNode          *node,
 
   switch (garcon_menu_node_tree_get_node_type (node))
     {
+    case GARCON_MENU_NODE_TYPE_CATEGORY:
+      matches = garcon_menu_item_has_category (item, garcon_menu_node_tree_get_string (node));
+      break;
+
     case GARCON_MENU_NODE_TYPE_INCLUDE:
     case GARCON_MENU_NODE_TYPE_EXCLUDE:
     case GARCON_MENU_NODE_TYPE_OR:
@@ -623,6 +627,11 @@ garcon_menu_node_tree_rule_matches (GNode          *node,
         matches = matches || garcon_menu_node_tree_rule_matches (child, item);
       break;
 
+    case GARCON_MENU_NODE_TYPE_FILENAME:
+      matches = g_str_equal (garcon_menu_node_tree_get_string (node),
+                             garcon_menu_item_get_desktop_id (item));
+      break;
+
     case GARCON_MENU_NODE_TYPE_AND:
       matches = TRUE;
       for (child = g_node_first_child (node); child != NULL; child = g_node_next_sibling (child))
@@ -635,15 +644,6 @@ garcon_menu_node_tree_rule_matches (GNode          *node,
       matches = !child_matches;
       break;
 
-    case GARCON_MENU_NODE_TYPE_FILENAME:
-      matches = g_str_equal (garcon_menu_node_tree_get_string (node),
-                             garcon_menu_item_get_desktop_id (item));
-      break;
-
-    case GARCON_MENU_NODE_TYPE_CATEGORY:
-      matches = garcon_menu_item_has_category (item, garcon_menu_node_tree_get_string (node));
-      break;
-
     case GARCON_MENU_NODE_TYPE_ALL:
       matches = TRUE;
       break;



More information about the Xfce4-commits mailing list