1 diff -urN aa/desktop-file-utils-0.7/src/menu-entries.c desktop-file-utils-0.7/src/menu-entries.c
2 --- aa/desktop-file-utils-0.7/src/menu-entries.c 2004-07-28 15:19:30.490876392 +0200
3 +++ desktop-file-utils-0.7/src/menu-entries.c 2004-07-28 21:28:13.552659792 +0200
7 unsigned int *categories; /* 0-terminated array of atoms */
14 entry_new (EntryType type,
15 const char *relative_path,
16 - const char *absolute_path)
17 + const char *absolute_path,
23 e->relative_path = g_strdup (relative_path);
24 e->absolute_path = g_strdup (absolute_path);
31 return entry->relative_path;
34 +gboolean entry_get_show (Entry *entry)
40 entry_has_category (Entry *entry,
46 - e = entry_new (src->type, relative_path, src->absolute_path);
47 + e = entry_new (src->type, relative_path, src->absolute_path, src->show);
49 n_categories_to_copy = 0;
52 if (src->type != ENTRY_DIRECTORY)
55 - e = entry_new (src->type, relative_path, src->absolute_path);
56 + e = entry_new (src->type, relative_path, src->absolute_path, src->show);
64 - e = entry_new (ENTRY_DESKTOP, basename, filename);
65 + e = entry_new (ENTRY_DESKTOP, basename, filename, TRUE);
67 categories = find_value (str, "Categories");
68 if (categories != NULL)
69 @@ -1893,7 +1901,48 @@
70 entry_new_directory_from_file (const char *filename,
73 - return entry_new (ENTRY_DIRECTORY, basename, filename);
84 + if (!g_file_get_contents (filename, &str, &len, &err))
86 + menu_verbose ("Could not get contents of \"%s\": %s\n",
87 + filename, err->message);
92 + /* Check for NoDisplay */
97 + nodisplay = find_value (str, "NoDisplay");
99 + if (nodisplay != NULL)
100 + if (strcasecmp (nodisplay, "True") == 0)
104 + menu_verbose ("Not showing \"%s\" due to NoDisplay=%s\n",
105 + filename, nodisplay);
107 + g_free (nodisplay);
109 + /* End checking for NoDisplay */
111 + e = entry_new (ENTRY_DIRECTORY, basename, filename, show);
119 diff -urN aa/desktop-file-utils-0.7/src/menu-entries.h desktop-file-utils-0.7/src/menu-entries.h
120 --- aa/desktop-file-utils-0.7/src/menu-entries.h 2004-07-28 15:19:30.491876240 +0200
121 +++ desktop-file-utils-0.7/src/menu-entries.h 2004-07-28 20:09:57.515565944 +0200
123 const char* entry_get_absolute_path (Entry *entry);
124 const char* entry_get_relative_path (Entry *entry);
125 const char* entry_get_name (Entry *entry);
126 +gboolean entry_get_show (Entry *entry);
127 gboolean entry_has_category (Entry *entry,
129 const char *category);
130 diff -urN aa/desktop-file-utils-0.7/src/menu-process.c desktop-file-utils-0.7/src/menu-process.c
131 --- aa/desktop-file-utils-0.7/src/menu-process.c 2004-07-28 15:19:30.501874720 +0200
132 +++ desktop-file-utils-0.7/src/menu-process.c 2004-07-28 21:42:52.369059392 +0200
133 @@ -1062,6 +1062,7 @@
134 GHashTable *allocated,
135 const DesktopEntryTree *tree);
136 static void remove_empty_submenus (TreeNode * node);
137 +static void remove_no_display_submenus (TreeNode * node);
138 static void process_only_unallocated (TreeNode *node,
139 GHashTable *allocated);
141 @@ -1238,6 +1239,7 @@
142 tree->root = new_node;
143 process_only_unallocated (tree->root, allocated);
144 remove_empty_submenus (tree->root);
145 + remove_no_display_submenus(tree->root);
147 /* Update the modification time for the tree, so the
148 * panel knows to reload the VFS directory.
149 @@ -2254,6 +2256,30 @@
153 +static void remove_no_display_submenus (TreeNode * node)
157 + subdir = node->subdirs;
158 + while (subdir != NULL)
160 + TreeNode *subdir_node = subdir->data;
161 + GSList *next = subdir->next;
163 + if (subdir_node->dir_entry &&
164 + entry_get_show (subdir_node->dir_entry) == FALSE)
166 + node->subdirs = g_slist_remove_link (node->subdirs, subdir);
167 + tree_node_free (subdir_node);
170 + remove_no_display_submenus (subdir_node);
178 build_tree (DesktopEntryTree *tree)
180 @@ -2271,8 +2297,10 @@
182 process_only_unallocated (tree->root, allocated);
186 remove_empty_submenus (tree->root);
187 + remove_no_display_submenus (tree->root);
190 g_hash_table_destroy (allocated);