]>
Commit | Line | Data |
---|---|---|
757ca5e4 | 1 | diff -urN aa/desktop-file-utils-0.6/src/menu-entries.c desktop-file-utils-0.6/src/menu-entries.c |
2 | --- aa/desktop-file-utils-0.6/src/menu-entries.c 2004-07-22 01:22:36.741865272 +0200 | |
3 | +++ desktop-file-utils-0.6/src/menu-entries.c 2004-07-22 01:37:57.796843632 +0200 | |
4 | @@ -1753,6 +1753,7 @@ | |
5 | GError *err; | |
6 | char *categories; | |
7 | Entry *e; | |
8 | + gboolean show; | |
9 | ||
10 | str = NULL; | |
11 | len = 0; | |
12 | @@ -1765,10 +1766,32 @@ | |
13 | return NULL; | |
14 | } | |
15 | ||
16 | + /* Check for NoDisplay */ | |
17 | + char *nodisplay; | |
18 | + | |
19 | + show = TRUE; | |
20 | + | |
21 | + nodisplay = find_value (str, "NoDisplay"); | |
22 | + | |
23 | + if (nodisplay != NULL) | |
24 | + if (strcasecmp (nodisplay, "True") == 0) | |
25 | + show = FALSE; | |
26 | + | |
27 | + if (!show) | |
28 | + menu_verbose ("Not showing \"%s\" due to NoDisplay=%s\n", | |
29 | + filename, nodisplay); | |
30 | + | |
31 | + g_free (nodisplay); | |
32 | + | |
33 | + if (!show){ | |
34 | + g_free (str); | |
35 | + return NULL; | |
36 | + } | |
37 | + /* End checking for NoDisplay */ | |
38 | + | |
39 | if (cache->only_show_in_name) | |
40 | { | |
41 | char *onlyshowin; | |
42 | - gboolean show; | |
43 | ||
44 | show = TRUE; | |
45 | ||
46 | diff -urN aa/desktop-file-utils-0.6/src/menu-layout.c desktop-file-utils-0.6/src/menu-layout.c | |
47 | --- aa/desktop-file-utils-0.6/src/menu-layout.c 2004-07-22 01:22:36.741865272 +0200 | |
48 | +++ desktop-file-utils-0.6/src/menu-layout.c 2004-07-22 01:43:43.405303160 +0200 | |
49 | @@ -1645,6 +1645,9 @@ | |
50 | case MENU_NODE_MENU_ONLY_SHOW_IN: | |
51 | append_simple (node, depth, "OnlyShowIn", str); | |
52 | break; | |
53 | + case MENU_NODE_MENU_NO_DISPLAY: | |
54 | + append_simple (node, depth, "NoDisplay", str); | |
55 | + break; | |
56 | case MENU_NODE_APP_DIR: | |
57 | append_simple (node, depth, "AppDir", str); | |
58 | break; | |
59 | diff -urN aa/desktop-file-utils-0.6/src/menu-layout.h desktop-file-utils-0.6/src/menu-layout.h | |
60 | --- aa/desktop-file-utils-0.6/src/menu-layout.h 2004-07-22 01:22:36.741865272 +0200 | |
61 | +++ desktop-file-utils-0.6/src/menu-layout.h 2004-07-22 01:43:10.477308976 +0200 | |
62 | @@ -37,6 +37,7 @@ | |
63 | MENU_NODE_PASSTHROUGH, | |
64 | MENU_NODE_MENU, | |
65 | MENU_NODE_MENU_ONLY_SHOW_IN, | |
66 | + MENU_NODE_MENU_NO_DISPLAY, | |
67 | MENU_NODE_APP_DIR, | |
68 | MENU_NODE_DEFAULT_APP_DIRS, | |
69 | MENU_NODE_DIRECTORY_DIR, | |
70 | diff -urN aa/desktop-file-utils-0.6/src/menu-parser.c desktop-file-utils-0.6/src/menu-parser.c | |
71 | --- aa/desktop-file-utils-0.6/src/menu-parser.c 2004-07-22 01:22:36.742865120 +0200 | |
72 | +++ desktop-file-utils-0.6/src/menu-parser.c 2004-07-22 01:45:04.482977480 +0200 | |
73 | @@ -338,6 +338,10 @@ | |
74 | { | |
75 | push_node (parser, MENU_NODE_MENU_ONLY_SHOW_IN); | |
76 | } | |
77 | + else if (ELEMENT_IS ("NoDisplay")) | |
78 | + { | |
79 | + push_node (parser, MENU_NODE_MENU_NO_DISPLAY); | |
80 | + } | |
81 | else if (ELEMENT_IS ("AppDir")) | |
82 | { | |
83 | push_node (parser, MENU_NODE_APP_DIR); | |
84 | @@ -785,6 +789,7 @@ | |
85 | switch (menu_node_get_type (parser->stack_top)) | |
86 | { | |
87 | case MENU_NODE_MENU_ONLY_SHOW_IN: | |
88 | + case MENU_NODE_MENU_NO_DISPLAY: | |
89 | case MENU_NODE_APP_DIR: | |
90 | case MENU_NODE_DIRECTORY_DIR: | |
91 | case MENU_NODE_NAME: | |
92 | @@ -873,6 +878,7 @@ | |
93 | switch (menu_node_get_type (parser->stack_top)) | |
94 | { | |
95 | case MENU_NODE_MENU_ONLY_SHOW_IN: | |
96 | + case MENU_NODE_MENU_NO_DISPLAY: | |
97 | case MENU_NODE_APP_DIR: | |
98 | case MENU_NODE_DIRECTORY_DIR: | |
99 | case MENU_NODE_NAME: | |
100 | diff -urN aa/desktop-file-utils-0.6/src/menu-process.c desktop-file-utils-0.6/src/menu-process.c | |
101 | --- aa/desktop-file-utils-0.6/src/menu-process.c 2004-07-22 01:22:36.746864512 +0200 | |
102 | +++ desktop-file-utils-0.6/src/menu-process.c 2004-07-22 01:49:07.279066864 +0200 | |
103 | @@ -1995,6 +1995,13 @@ | |
104 | } | |
105 | break; | |
106 | ||
107 | + case MENU_NODE_MENU_NO_DISPLAY: | |
108 | + { | |
109 | + if (strcasecmp (menu_node_get_content (child), "True") == 0) | |
110 | + deleted = TRUE; | |
111 | + } | |
112 | + break; | |
113 | + | |
114 | case MENU_NODE_NAME: | |
115 | { | |
116 | if (tree_node->name) |