]> git.pld-linux.org Git - packages/desktop-file-utils.git/blame - desktop-file-utils-directory_onlyshowin.patch
- updated for 0.8
[packages/desktop-file-utils.git] / desktop-file-utils-directory_onlyshowin.patch
CommitLineData
b551c231 1diff -urN aa/desktop-file-utils-0.8/src/menu-entries.c desktop-file-utils-0.8/src/menu-entries.c
2--- aa/desktop-file-utils-0.8/src/menu-entries.c 2004-09-07 18:17:31.251622656 +0200
3+++ desktop-file-utils-0.8/src/menu-entries.c 2004-09-07 18:29:07.293808160 +0200
4@@ -2027,12 +2027,14 @@
5 }
375d3e7a 6
b551c231 7 static Entry*
8-entry_new_directory_from_file (const char *filename,
9+entry_new_directory_from_file (EntryCache *cache,
10+ const char *filename,
11 const char *basename)
12 {
13 char *str;
14 GError *err;
15 char *nodisplay_str;
375d3e7a 16+ char *onlyshowin;
b551c231 17 gboolean nodisplay;
18
19 str = NULL;
20@@ -2058,6 +2060,35 @@
21
22 g_free (nodisplay_str);
23 }
24+
25+ if (cache->only_show_in_name && nodisplay == FALSE)
26+ {
27+ onlyshowin = find_value (str, "OnlyShowIn");
375d3e7a 28+
b551c231 29+ if (onlyshowin != NULL)
30+ {
31+ char **split;
32+ int i;
375d3e7a 33+
b551c231 34+ nodisplay = TRUE;
375d3e7a 35+
b551c231 36+ split = string_list_from_desktop_value (onlyshowin);
37+ i = 0;
38+ while (split[i] != NULL)
39+ {
40+ if (strcmp (split[i], cache->only_show_in_name) == 0)
41+ {
42+ nodisplay = FALSE;
43+ break;
44+ }
45+
46+ ++i;
47+ }
375d3e7a 48+
b551c231 49+ g_strfreev (split);
50+ g_free (onlyshowin);
51+ }
52+ }
53
54 return entry_new (ENTRY_DIRECTORY, basename, filename, nodisplay);
55 }
56@@ -2162,7 +2193,7 @@
57 {
58 Entry *e;
59
60- e = entry_new_directory_from_file (fullpath, dent->d_name);
61+ e = entry_new_directory_from_file (dir->cache, fullpath, dent->d_name);
62
63 menu_verbose ("Tried loading \"%s\": %s\n",
64 fullpath, e ? "ok" : "failed");
This page took 0.087133 seconds and 4 git commands to generate.