efreet_desktop.c \
efreet_menu.c \
efreet_utils.c \
-efreet_uri.c \
-efreet_cache.c
+efreet_uri.c
installed_headersdir = $(includedir)/efreet
+++ /dev/null
-/* vim: set sw=4 ts=4 sts=4 et: */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-
-#include "Efreet.h"
-#include "efreet_private.h"
-
-/* FIXME: need a mmaped hash file that apps can share */
-
-static Eina_Hash *icon_cache = NULL;
-
-static void
-path_free(const char *path)
-{
- if (path == NON_EXISTING) return;
- eina_stringshare_del(path);
-}
-
-static void
-icon_cache_add(void)
-{
- if (icon_cache) return;
- icon_cache = eina_hash_string_superfast_new(EINA_FREE_CB(path_free));
-}
-
-void
-efreet_cache_clear(void)
-{
- if (!icon_cache) return;
- IF_FREE_HASH(icon_cache);
- icon_cache = NULL;
-}
-
-const char *
-efreet_icon_hash_get(const char *theme_name, const char *icon, int size)
-{
- const char *file;
- char buf[4096];
-
- if (!icon_cache) return NULL;
- snprintf(buf, sizeof(buf), "%s/::/%s/::/%i", theme_name, icon, size);
- file = eina_hash_find(icon_cache, buf);
- return file;
-}
-
-void
-efreet_icon_hash_put(const char *theme_name, const char *icon, int size, const char *file)
-{
- char buf[4096];
-
- icon_cache_add();
- if (!icon_cache) return;
- snprintf(buf, sizeof(buf), "%s/::/%s/::/%i", theme_name, icon, size);
- if (file == NON_EXISTING)
- eina_hash_add(icon_cache, buf, (void *)NON_EXISTING);
- else if (file)
- eina_hash_add(icon_cache, buf, (void *)eina_stringshare_add(file));
-}
EAPI char *
efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size)
{
- const char *cached;
char *value;
Efreet_Icon_Theme *theme;
- if ((cached = efreet_icon_hash_get(theme_name, icon, size)) != NULL)
- {
- if (cached == NON_EXISTING) return NULL;
- return strdup(cached);
- }
theme = efreet_icon_find_theme_check(theme_name);
#ifdef SLOPPY_SPEC
*/
if (!value || (value == NON_EXISTING)) value = efreet_icon_fallback_icon(icon);
- efreet_icon_hash_put(theme_name, icon, size, value);
-
if (value == NON_EXISTING) value = NULL;
return value;
}
if (!l) eina_hash_add(efreet_icon_cache, theme, list);
else eina_hash_modify(efreet_icon_cache, theme, list);
- efreet_icon_cache_flush(theme, list);
+ //efreet_icon_cache_flush(theme, list);
}
#define NON_EXISTING (void *)-1
-void efreet_cache_clear(void);
-const char *efreet_icon_hash_get(const char *theme_name, const char *icon, int size);
-void efreet_icon_hash_put(const char *theme_name, const char *icon, int size, const char *file);
-
/**
* @}
*/
free(fill);
idler = NULL;
fill = NULL;
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_LIST_CHANGE, NULL, NULL, NULL);
return 0;
eina_hash_foreach(file_id_by_desktop_path, dump, NULL);
DBG("%d", eina_hash_population(desktop_by_file_id));
#endif
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_LIST_CHANGE, NULL, NULL, NULL);
return 0;
ev->current = desktop;
efreet_desktop_ref(ev->current);
ev->change = EFREET_DESKTOP_CHANGE_ADD;
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_CHANGE, ev, efreet_event_desktop_change_free, NULL);
}
}
ev->change = EFREET_DESKTOP_CHANGE_UPDATE;
efreet_desktop_free(ud->desktop);
ud->desktop = desktop;
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_CHANGE, ev, efreet_event_desktop_change_free, NULL);
}
else
ev->current = ud->desktop;
efreet_desktop_ref(ev->current);
ev->change = EFREET_DESKTOP_CHANGE_REMOVE;
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_CHANGE, ev, efreet_event_desktop_change_free, NULL);
eina_hash_del(desktop_by_file_id, file_id, ud);
ev->previous = ud->desktop;
efreet_desktop_ref(ev->previous);
ev->change = EFREET_DESKTOP_CHANGE_UPDATE;
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_CHANGE, ev, efreet_event_desktop_change_free, NULL);
efreet_desktop_free(ud->desktop);
ev->current = desktop;
efreet_desktop_ref(ev->current);
ev->change = EFREET_DESKTOP_CHANGE_ADD;
- efreet_cache_clear();
ecore_event_add(EFREET_EVENT_DESKTOP_CHANGE, ev, efreet_event_desktop_change_free, NULL);
}
}