forked from enlightenment/efl
efreet: Don't keep desktop_dirs permanently
SVN revision: 62583
This commit is contained in:
parent
6ac66e7427
commit
352ec9086c
|
@ -66,7 +66,6 @@ static Eet_Data_Descriptor *array_string_edd = NULL;
|
||||||
static Eet_Data_Descriptor *hash_string_edd = NULL;
|
static Eet_Data_Descriptor *hash_string_edd = NULL;
|
||||||
|
|
||||||
static Eina_Hash *desktops = NULL;
|
static Eina_Hash *desktops = NULL;
|
||||||
static Efreet_Cache_Array_String *desktop_dirs = NULL;
|
|
||||||
static Eina_List *desktop_dirs_add = NULL;
|
static Eina_List *desktop_dirs_add = NULL;
|
||||||
static Eet_File *desktop_cache = NULL;
|
static Eet_File *desktop_cache = NULL;
|
||||||
static const char *desktop_cache_file = NULL;
|
static const char *desktop_cache_file = NULL;
|
||||||
|
@ -203,8 +202,6 @@ efreet_cache_shutdown(void)
|
||||||
IF_FREE_HASH(fallbacks);
|
IF_FREE_HASH(fallbacks);
|
||||||
|
|
||||||
IF_FREE_HASH_CB(desktops, EINA_FREE_CB(efreet_cache_desktop_free));
|
IF_FREE_HASH_CB(desktops, EINA_FREE_CB(efreet_cache_desktop_free));
|
||||||
efreet_cache_array_string_free(desktop_dirs);
|
|
||||||
desktop_dirs = NULL;
|
|
||||||
EINA_LIST_FREE(desktop_dirs_add, data)
|
EINA_LIST_FREE(desktop_dirs_add, data)
|
||||||
eina_stringshare_del(data);
|
eina_stringshare_del(data);
|
||||||
desktop_cache = efreet_cache_close(desktop_cache);
|
desktop_cache = efreet_cache_close(desktop_cache);
|
||||||
|
@ -929,6 +926,7 @@ efreet_cache_desktop_add(Efreet_Desktop *desktop)
|
||||||
if (!strcmp(dir, arr->array[i]))
|
if (!strcmp(dir, arr->array[i]))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
efreet_cache_array_string_free(arr);
|
||||||
}
|
}
|
||||||
if (!eina_list_search_unsorted_list(desktop_dirs_add, strcmplen, dir))
|
if (!eina_list_search_unsorted_list(desktop_dirs_add, strcmplen, dir))
|
||||||
desktop_dirs_add = eina_list_append(desktop_dirs_add, eina_stringshare_add(dir));
|
desktop_dirs_add = eina_list_append(desktop_dirs_add, eina_stringshare_add(dir));
|
||||||
|
@ -939,12 +937,9 @@ efreet_cache_desktop_add(Efreet_Desktop *desktop)
|
||||||
Efreet_Cache_Array_String *
|
Efreet_Cache_Array_String *
|
||||||
efreet_cache_desktop_dirs(void)
|
efreet_cache_desktop_dirs(void)
|
||||||
{
|
{
|
||||||
if (desktop_dirs) return desktop_dirs;
|
|
||||||
|
|
||||||
if (!efreet_cache_check(&desktop_cache, efreet_desktop_cache_file(), EFREET_DESKTOP_CACHE_MAJOR)) return NULL;
|
if (!efreet_cache_check(&desktop_cache, efreet_desktop_cache_file(), EFREET_DESKTOP_CACHE_MAJOR)) return NULL;
|
||||||
|
|
||||||
desktop_dirs = eet_data_read(desktop_cache, efreet_array_string_edd(), EFREET_CACHE_DESKTOP_DIRS);
|
return eet_data_read(desktop_cache, efreet_array_string_edd(), EFREET_CACHE_DESKTOP_DIRS);
|
||||||
return desktop_dirs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1132,8 +1127,6 @@ cache_update_cb(void *data __UNUSED__, Ecore_File_Monitor *em __UNUSED__,
|
||||||
d->ef = desktop_cache;
|
d->ef = desktop_cache;
|
||||||
old_desktop_caches = eina_list_append(old_desktop_caches, d);
|
old_desktop_caches = eina_list_append(old_desktop_caches, d);
|
||||||
|
|
||||||
efreet_cache_array_string_free(desktop_dirs);
|
|
||||||
desktop_dirs = NULL;
|
|
||||||
desktops = eina_hash_string_superfast_new(NULL);
|
desktops = eina_hash_string_superfast_new(NULL);
|
||||||
desktop_cache = NULL;
|
desktop_cache = NULL;
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,6 @@ EAPI const char *efreet_desktop_cache_file(void);
|
||||||
EAPI const char *efreet_icon_cache_file(const char *theme);
|
EAPI const char *efreet_icon_cache_file(const char *theme);
|
||||||
EAPI const char *efreet_icon_theme_cache_file(void);
|
EAPI const char *efreet_icon_theme_cache_file(void);
|
||||||
|
|
||||||
EAPI void efreet_cache_array_string_free(Efreet_Cache_Array_String *array);
|
|
||||||
|
|
||||||
EAPI Eet_Data_Descriptor *efreet_version_edd(void);
|
EAPI Eet_Data_Descriptor *efreet_version_edd(void);
|
||||||
EAPI Eet_Data_Descriptor *efreet_desktop_edd(void);
|
EAPI Eet_Data_Descriptor *efreet_desktop_edd(void);
|
||||||
EAPI Eet_Data_Descriptor *efreet_hash_array_string_edd(void);
|
EAPI Eet_Data_Descriptor *efreet_hash_array_string_edd(void);
|
||||||
|
|
|
@ -984,6 +984,7 @@ efreet_desktop_changes_listen(void)
|
||||||
|
|
||||||
for (i = 0; i < arr->array_count; i++)
|
for (i = 0; i < arr->array_count; i++)
|
||||||
efreet_desktop_changes_monitor_add(arr->array[i]);
|
efreet_desktop_changes_monitor_add(arr->array[i]);
|
||||||
|
efreet_cache_array_string_free(arr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,6 +205,8 @@ Efreet_Cache_Hash *efreet_cache_util_hash_string(const char *key);
|
||||||
Efreet_Cache_Hash *efreet_cache_util_hash_array_string(const char *key);
|
Efreet_Cache_Hash *efreet_cache_util_hash_array_string(const char *key);
|
||||||
Efreet_Cache_Array_String *efreet_cache_util_names(const char *key);
|
Efreet_Cache_Array_String *efreet_cache_util_names(const char *key);
|
||||||
|
|
||||||
|
EAPI void efreet_cache_array_string_free(Efreet_Cache_Array_String *array);
|
||||||
|
|
||||||
EAPI void efreet_hash_free(Eina_Hash *hash, Eina_Free_Cb free_cb);
|
EAPI void efreet_hash_free(Eina_Hash *hash, Eina_Free_Cb free_cb);
|
||||||
EAPI void efreet_setowner(const char *path);
|
EAPI void efreet_setowner(const char *path);
|
||||||
EAPI void efreet_fsetowner(int fd);
|
EAPI void efreet_fsetowner(int fd);
|
||||||
|
|
Loading…
Reference in New Issue