efreet_cache.c | efreet_cache.c | |||
---|---|---|---|---|
skipping to change at line 268 | skipping to change at line 268 | |||
/* | /* | |||
* Needs EAPI because of helper binaries | * Needs EAPI because of helper binaries | |||
*/ | */ | |||
EAPI const char * | EAPI const char * | |||
efreet_icon_cache_file(const char *theme) | efreet_icon_cache_file(const char *theme) | |||
{ | { | |||
static char cache_file[PATH_MAX] = { '\0' }; | static char cache_file[PATH_MAX] = { '\0' }; | |||
const char *cache; | const char *cache; | |||
EINA_SAFETY_ON_NULL_RETURN_VAL(theme, NULL); | ||||
cache = efreet_cache_home_get(); | cache = efreet_cache_home_get(); | |||
snprintf(cache_file, sizeof(cache_file), "%s/efreet/icons_%s_%s.eet", c ache, theme, efreet_hostname_get()); | snprintf(cache_file, sizeof(cache_file), "%s/efreet/icons_%s_%s.eet", c ache, theme, efreet_hostname_get()); | |||
return cache_file; | return cache_file; | |||
} | } | |||
/* | /* | |||
* Needs EAPI because of helper binaries | * Needs EAPI because of helper binaries | |||
*/ | */ | |||
skipping to change at line 954 | skipping to change at line 956 | |||
{ | { | |||
if (!efreet_cache_update) return; | if (!efreet_cache_update) return; | |||
if (desktop_cache_timer) | if (desktop_cache_timer) | |||
ecore_timer_delay(desktop_cache_timer, 0.2); | ecore_timer_delay(desktop_cache_timer, 0.2); | |||
else | else | |||
desktop_cache_timer = ecore_timer_add(0.2, desktop_cache_update_cac he_cb, NULL); | desktop_cache_timer = ecore_timer_add(0.2, desktop_cache_update_cac he_cb, NULL); | |||
} | } | |||
void | void | |||
efreet_cache_desktop_close(void) | ||||
{ | ||||
IF_RELEASE(util_cache_names_key); | ||||
IF_RELEASE(util_cache_hash_key); | ||||
if ((desktop_cache) && (desktop_cache != NON_EXISTING)) | ||||
{ | ||||
Efreet_Old_Cache *d = NEW(Efreet_Old_Cache, 1); | ||||
if (d) | ||||
{ | ||||
d->hash = desktops; | ||||
d->ef = desktop_cache; | ||||
old_desktop_caches = eina_list_append(old_desktop_caches, d); | ||||
} | ||||
desktops = eina_hash_string_superfast_new(NULL); | ||||
} | ||||
desktop_cache = NULL; | ||||
efreet_cache_array_string_free(util_cache_names); | ||||
util_cache_names = NULL; | ||||
if (util_cache_hash) | ||||
{ | ||||
eina_hash_free(util_cache_hash->hash); | ||||
free(util_cache_hash); | ||||
util_cache_hash = NULL; | ||||
} | ||||
util_cache = efreet_cache_close(util_cache); | ||||
IF_RELEASE(desktop_cache_file); | ||||
IF_RELEASE(util_cache_file); | ||||
} | ||||
void | ||||
efreet_cache_icon_update(void) | efreet_cache_icon_update(void) | |||
{ | { | |||
if (!efreet_cache_update) return; | if (!efreet_cache_update) return; | |||
if (icon_cache_timer) | if (icon_cache_timer) | |||
ecore_timer_delay(icon_cache_timer, 0.2); | ecore_timer_delay(icon_cache_timer, 0.2); | |||
else | else | |||
icon_cache_timer = ecore_timer_add(0.2, icon_cache_update_cache_cb, NULL); | icon_cache_timer = ecore_timer_add(0.2, icon_cache_update_cache_cb, NULL); | |||
} | } | |||
skipping to change at line 1114 | skipping to change at line 1152 | |||
Efreet_Old_Cache *d = NULL; | Efreet_Old_Cache *d = NULL; | |||
Eina_List *l = NULL; | Eina_List *l = NULL; | |||
if (event != ECORE_FILE_EVENT_CLOSED) | if (event != ECORE_FILE_EVENT_CLOSED) | |||
return; | return; | |||
file = ecore_file_file_get(path); | file = ecore_file_file_get(path); | |||
if (!file) return; | if (!file) return; | |||
if (!strcmp(file, "desktop_data.update")) | if (!strcmp(file, "desktop_data.update")) | |||
{ | { | |||
ev = NEW(Efreet_Event_Cache_Update, 1); | ||||
if (!ev) goto error; | ||||
if (cache_check_change(path)) | if (cache_check_change(path)) | |||
{ | { | |||
IF_RELEASE(util_cache_names_key); | ev = NEW(Efreet_Event_Cache_Update, 1); | |||
IF_RELEASE(util_cache_hash_key); | if (!ev) goto error; | |||
if ((desktop_cache) && (desktop_cache != NON_EXISTING)) | ||||
{ | ||||
d = NEW(Efreet_Old_Cache, 1); | ||||
if (!d) goto error; | ||||
d->hash = desktops; | ||||
d->ef = desktop_cache; | ||||
old_desktop_caches = eina_list_append(old_desktop_caches, d | ||||
); | ||||
desktops = eina_hash_string_superfast_new(NULL); | ||||
} | ||||
desktop_cache = NULL; | ||||
efreet_cache_array_string_free(util_cache_names); | ||||
util_cache_names = NULL; | ||||
if (util_cache_hash) | ||||
{ | ||||
eina_hash_free(util_cache_hash->hash); | ||||
free(util_cache_hash); | ||||
util_cache_hash = NULL; | ||||
} | ||||
util_cache = efreet_cache_close(util_cache); | efreet_cache_desktop_close(); | |||
ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, desktop_ cache_update_free, d); | ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, ev, desktop_ cache_update_free, d); | |||
} | } | |||
ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL) ; | ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL) ; | |||
/* TODO: Check if desktop_dirs_add exists, and rebuild cache if */ | /* TODO: Check if desktop_dirs_add exists, and rebuild cache if */ | |||
} | } | |||
else if (!strcmp(file, "icon_data.update")) | else if (!strcmp(file, "icon_data.update")) | |||
{ | { | |||
if (cache_check_change(path)) | if (cache_check_change(path)) | |||
{ | { | |||
End of changes. 5 change blocks. | ||||
28 lines changed or deleted | 41 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |