[gnome-menus] util: Add --include-unallocated option to gnome-menu-spec-test



commit b93cc6818c7ee7be1339f0f7bf8d3ec24790df59
Author: Vincent Untz <vuntz gnome org>
Date:   Thu Feb 2 10:19:02 2012 +0100

    util: Add --include-unallocated option to gnome-menu-spec-test
    
    We want easy testing for GMENU_TREE_FLAGS_INCLUDE_UNALLOCATED.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668512

 util/test-menu-spec.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/util/test-menu-spec.c b/util/test-menu-spec.c
index f8e6eb6..c48509e 100644
--- a/util/test-menu-spec.c
+++ b/util/test-menu-spec.c
@@ -34,12 +34,14 @@ static char     *menu_file = NULL;
 static gboolean  monitor = FALSE;
 static gboolean  include_excluded = FALSE;
 static gboolean  include_nodisplay = FALSE;
+static gboolean  include_unallocated = FALSE;
 
 static GOptionEntry options[] = {
-  { "file",              'f', 0, G_OPTION_ARG_STRING, &menu_file,         N_("Menu file"),                      N_("MENU_FILE") },
-  { "monitor",           'm', 0, G_OPTION_ARG_NONE,   &monitor,           N_("Monitor for menu changes"),       NULL },
-  { "include-excluded",  'i', 0, G_OPTION_ARG_NONE,   &include_excluded,  N_("Include <Exclude>d entries"),     NULL },
-  { "include-nodisplay", 'n', 0, G_OPTION_ARG_NONE,   &include_nodisplay, N_("Include NoDisplay=true entries"), NULL },
+  { "file",                'f', 0, G_OPTION_ARG_STRING, &menu_file,           N_("Menu file"),                      N_("MENU_FILE") },
+  { "monitor",             'm', 0, G_OPTION_ARG_NONE,   &monitor,             N_("Monitor for menu changes"),       NULL },
+  { "include-excluded",    'i', 0, G_OPTION_ARG_NONE,   &include_excluded,    N_("Include <Exclude>d entries"),     NULL },
+  { "include-nodisplay",   'n', 0, G_OPTION_ARG_NONE,   &include_nodisplay,   N_("Include NoDisplay=true entries"), NULL },
+  { "include-unallocated", 'u', 0, G_OPTION_ARG_NONE,   &include_unallocated, N_("Include unallocated entries"), NULL },
   { NULL }
 };
 
@@ -224,6 +226,8 @@ main (int argc, char **argv)
     flags |= GMENU_TREE_FLAGS_INCLUDE_EXCLUDED;
   if (include_nodisplay)
     flags |= GMENU_TREE_FLAGS_INCLUDE_NODISPLAY;
+  if (include_unallocated)
+    flags |= GMENU_TREE_FLAGS_INCLUDE_UNALLOCATED;
 
   tree = gmenu_tree_new (menu_file ? menu_file : "applications.menu", flags);
   g_assert (tree != NULL);



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