cache .directory files also
authorenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 13 Mar 2010 20:58:17 +0000 (20:58 +0000)
committerenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 13 Mar 2010 20:58:17 +0000 (20:58 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@47186 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/efreet_desktop_cache_create.c

index 8ffb6d3..615f1a1 100644 (file)
@@ -39,10 +39,11 @@ cache_add(const char *path, const char *file_id, int priority __UNUSED__)
     char *ext;
 
     ext = strrchr(path, '.');
-    if (!ext || strcmp(ext, ".desktop")) return 1;
+    if (!ext || (strcmp(ext, ".desktop") && strcmp(ext, ".directory"))) return 1;
     desk = efreet_desktop_new(path);
 
-    if (!desk || desk->type != EFREET_DESKTOP_TYPE_APPLICATION)
+    if (!desk || (desk->type != EFREET_DESKTOP_TYPE_APPLICATION &&
+                  desk->type != EFREET_DESKTOP_TYPE_DIRECTORY))
     {
         if (desk) efreet_desktop_free(desk);
         return 1;
@@ -54,7 +55,8 @@ cache_add(const char *path, const char *file_id, int priority __UNUSED__)
         eina_hash_add(paths, desk->orig_path, (void *)1);
     }
     /* TODO: We should check priority, and not just hope we search in right order */
-    if (file_id && !eina_hash_find(file_ids, file_id))
+    if (desk->type == EFREET_DESKTOP_TYPE_APPLICATION &&
+        file_id && !eina_hash_find(file_ids, file_id))
     {
         int id;
         char key[PATH_MAX];