gaaaaah! fix buf - paths were "wrong" - thus matching failed. man i see some

expensive ops going on with lots of strcmping.



SVN revision: 48917
This commit is contained in:
Carsten Haitzler 2010-05-16 17:11:38 +00:00
parent 79f1448682
commit 8bbc3b9024
2 changed files with 15 additions and 3 deletions

View 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);

View 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;