EAPI const char *
efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size)
{
+ char *tmp;
const char *value = NULL;
Efreet_Icon_Theme *theme;
theme = efreet_icon_theme_find(theme_name);
- if (theme)
- {
- char *tmp;
- Efreet_Cache_Icon *cache;
-
#ifdef SLOPPY_SPEC
- tmp = efreet_icon_remove_extension(icon);
- if (!tmp) return NULL;
+ tmp = efreet_icon_remove_extension(icon);
+ if (!tmp) return NULL;
#else
- tmp = icon;
+ tmp = icon;
#endif
+ if (theme)
+ {
+ Efreet_Cache_Icon *cache;
cache = efreet_cache_icon_find(theme, tmp);
value = efreet_cache_icon_lookup_icon(cache, size);
if (!value) INFO("lookup for `%s` failed in theme `%s` with %p.", icon, theme_name, cache);
-
-#ifdef SLOPPY_SPEC
- FREE(tmp);
-#endif
}
/* we didn't find the icon in the theme or in the inherited directories
{
Efreet_Cache_Fallback_Icon *cache;
- cache = efreet_cache_icon_fallback_find(icon);
+ cache = efreet_cache_icon_fallback_find(tmp);
value = efreet_cache_icon_fallback_lookup_path(cache);
if (!value) INFO("lookup for `%s` failed in fallback too with %p.", icon, cache);
}
if (value == NON_EXISTING) value = NULL;
+
+#ifdef SLOPPY_SPEC
+ FREE(tmp);
+#endif
return value;
}
unsigned int size)
{
Eina_List *l;
+ Eina_List *tmps = NULL;
const char *icon = NULL;
const char *value = NULL;
char *data;
theme = efreet_icon_theme_find(theme_name);
+#ifdef SLOPPY_SPEC
+ EINA_LIST_FOREACH(icons, l, icon)
+ {
+ data = efreet_icon_remove_extension(icon);
+ if (!data) return NULL;
+ tmps = eina_list_append(tmps, data);
+ }
+#else
+ tmps = icons;
+#endif
+
if (theme)
{
- Eina_List *tmps = NULL;
Eina_List *tmps2 = NULL;
Efreet_Cache_Icon *cache;
-#ifdef SLOPPY_SPEC
- EINA_LIST_FOREACH(icons, l, icon)
- {
- data = efreet_icon_remove_extension(icon);
- if (!data) return NULL;
- tmps = eina_list_append(tmps, data);
- }
-#else
- tmps = icons;
-#endif
-
EINA_LIST_FOREACH(tmps, l, icon)
{
cache = efreet_cache_icon_find(theme, icon);
value = efreet_cache_icon_list_lookup_icon(theme, tmps2, size);
eina_list_free(tmps2);
}
-
-#ifdef SLOPPY_SPEC
- EINA_LIST_FREE(tmps, data)
- free(data);
-#endif
}
/* we didn't find the icons in the theme or in the inherited directories
if (!value || (value == NON_EXISTING))
{
Efreet_Cache_Fallback_Icon *cache;
- EINA_LIST_FOREACH(icons, l, icon)
+ EINA_LIST_FOREACH(tmps, l, icon)
{
cache = efreet_cache_icon_fallback_find(icon);
value = efreet_cache_icon_fallback_lookup_path(cache);
}
}
+#ifdef SLOPPY_SPEC
+ EINA_LIST_FREE(tmps, data)
+ free(data);
+#endif
+
if (value == NON_EXISTING) value = NULL;
return value;
}