gaaaaah! fix buf - paths were "wrong" - thus matching failed. man i see some
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 16 May 2010 17:11:38 +0000 (17:11 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 16 May 2010 17:11:38 +0000 (17:11 +0000)
expensive ops going on with lots of strcmping.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@48917 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/efreet_base.c
src/lib/efreet_utils.c

index 0abaedb..79339c0 100644 (file)
@@ -8,6 +8,9 @@
 #include <string.h>
 #include <limits.h>
 
+#include <Ecore.h>
+#include <Ecore_File.h>
+
 #include "Efreet.h"
 #include "efreet_private.h"
 
@@ -243,7 +246,16 @@ efreet_dirs_get(const char *key, const char *fallback)
     {
         *p = '\0';
         if (!eina_list_search_unsorted(dirs, EINA_COMPARE_CB(strcmp), s))
-            dirs = eina_list_append(dirs, (void *)eina_stringshare_add(s));
+         {
+            // resolve path properly/fully to remove path//path2 to
+            // path/path2, path/./path2 to path/path2 etc.
+            char *ts = ecore_file_realpath(s);
+            if (ts)
+              {
+                 dirs = eina_list_append(dirs, (void *)eina_stringshare_add(ts));
+                 free(ts);
+              }
+         }
 
         s = ++p;
         p = strchr(s, EFREET_PATH_SEP);
index 8b6b96c..cb75990 100644 (file)
@@ -108,7 +108,7 @@ efreet_util_path_in_default(const char *section, const char *path)
     char *dir;
 
     dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
-                                                                    section);
+                                   section);
 
     EINA_LIST_FREE(dirs, dir)
     {
@@ -130,7 +130,7 @@ efreet_util_path_to_file_id(const char *path)
     const char *file_id;
 
     /* TODO: Check if searching in cache is fast enough */
-    if (!path) return NULL;
+    if (!path) return NULL; 
     file_id = eina_hash_find(file_id_by_desktop_path, path);
     if (file_id) return file_id;