]> git.pld-linux.org Git - packages/desktop-file-utils.git/blob - desktop-file-utils-directory_onlyshowin.patch
- updated for 0.8
[packages/desktop-file-utils.git] / desktop-file-utils-directory_onlyshowin.patch
1 diff -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  }
6  
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;
16 +  char *onlyshowin;
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");
28 +  
29 +      if (onlyshowin != NULL)
30 +        {
31 +          char **split;
32 +          int i;
33 +
34 +                                       nodisplay = TRUE;
35 +
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 +            }
48 +
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.06138 seconds and 3 git commands to generate.