forked from enlightenment/efl
Remember all paths, to avoid duplicates
SVN revision: 46744
This commit is contained in:
parent
bf8b3ce2a3
commit
59691e5660
|
@ -19,6 +19,7 @@ static Eet_File *ef = NULL;
|
||||||
static Eet_File *util_ef = NULL;
|
static Eet_File *util_ef = NULL;
|
||||||
|
|
||||||
static Eina_Hash *file_ids = NULL;
|
static Eina_Hash *file_ids = NULL;
|
||||||
|
static Eina_Hash *paths = NULL;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cache_add(const char *path, const char *file_id, int priority)
|
cache_add(const char *path, const char *file_id, int priority)
|
||||||
|
@ -35,8 +36,12 @@ cache_add(const char *path, const char *file_id, int priority)
|
||||||
if (desk) efreet_desktop_free(desk);
|
if (desk) efreet_desktop_free(desk);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!eet_data_write(ef, edd, desk->orig_path, desk, 0))
|
if (!eina_hash_find(paths, desk->orig_path))
|
||||||
return 0;
|
{
|
||||||
|
if (!eet_data_write(ef, edd, desk->orig_path, desk, 0))
|
||||||
|
return 0;
|
||||||
|
eina_hash_add(paths, desk->orig_path, (void *)1);
|
||||||
|
}
|
||||||
if (!eina_hash_find(file_ids, file_id))
|
if (!eina_hash_find(file_ids, file_id))
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
@ -218,8 +223,9 @@ main(int argc, char **argv)
|
||||||
if (!util_ef) goto error;
|
if (!util_ef) goto error;
|
||||||
|
|
||||||
file_ids = eina_hash_string_superfast_new(NULL);
|
file_ids = eina_hash_string_superfast_new(NULL);
|
||||||
|
|
||||||
if (!file_ids) goto error;
|
if (!file_ids) goto error;
|
||||||
|
paths = eina_hash_string_superfast_new(NULL);
|
||||||
|
if (!paths) goto error;
|
||||||
|
|
||||||
dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
|
dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
|
||||||
"applications");
|
"applications");
|
||||||
|
@ -238,6 +244,7 @@ main(int argc, char **argv)
|
||||||
dirs = eina_list_remove_list(dirs, dirs);
|
dirs = eina_list_remove_list(dirs, dirs);
|
||||||
}
|
}
|
||||||
eina_hash_free(file_ids);
|
eina_hash_free(file_ids);
|
||||||
|
eina_hash_free(paths);
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
eet_close(util_ef);
|
eet_close(util_ef);
|
||||||
|
|
Loading…
Reference in New Issue