Strip known extensions from icons.

SVN revision: 29345
This commit is contained in:
Sebastian Dransfeld 2007-04-04 11:52:46 +00:00
parent c6f6863b57
commit 0a2d7b785e
1 changed files with 30 additions and 0 deletions

View File

@ -248,7 +248,35 @@ efreet_icon_find(const char *theme_name, const char *icon, const char *size)
efreet_array_cat(cache_key, sizeof(cache_key), key_list);
share_key = ecore_string_instance(cache_key);
#ifdef SLOPPY_SPEC
{
char *tmp, *ext;
tmp = strdup(icon);
ext = strrchr(tmp, '.');
if (ext)
{
const char *ext2;
ecore_list_goto_first(efreet_icon_extensions);
while ((ext2 = ecore_list_next(efreet_icon_extensions)))
{
if (!strcmp(ext, ext2))
{
#ifdef STRICT_SPEC
printf("[Efreet]: Requesting an icon with an extension: %s\n", icon);
#endif
*ext = 0;
break;
}
}
}
value = efreet_icon_find_helper(theme, share_key, tmp, size);
free(tmp);
}
#else
value = efreet_icon_find_helper(theme, share_key, icon, size);
#endif
/* we didn't find the icon in the theme or in the inherited directories
* then just look for a non theme icon */
@ -575,6 +603,7 @@ efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
}
}
/* This is to catch non-conforming .desktop files */
#ifdef SLOPPY_SPEC
if (!icon)
{
const char *icon_path[] = { dir, "/", icon_name, NULL };
@ -589,6 +618,7 @@ efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
#endif
}
}
#endif
return icon;
}