On Tue, 3 Aug 2010, Enlightenment SVN wrote:

> Log:
>  ummmm revert. crash crash crash.

unit test suite needed for efreet :p

Vincent

>
>
> Author:       raster
> Date:         2010-08-03 14:32:45 -0700 (Tue, 03 Aug 2010)
> New Revision: 50789
>
> Modified:
>  trunk/efreet/src/lib/efreet_icon.c
>
> Modified: trunk/efreet/src/lib/efreet_icon.c
> ===================================================================
> --- trunk/efreet/src/lib/efreet_icon.c        2010-08-03 20:46:56 UTC (rev 
> 50788)
> +++ trunk/efreet/src/lib/efreet_icon.c        2010-08-03 21:32:45 UTC (rev 
> 50789)
> @@ -94,6 +94,8 @@
> static char *efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char 
> *icon, unsigned int size);
> static void efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, 
> unsigned int size, const char *value);
>
> +static Efreet_Icon_Theme *fake_null = NULL;
> +
> static void
> _efreet_icon_cache_list_destroy(Eina_List *list)
> {
> @@ -151,6 +153,12 @@
>
>     IF_FREE_HASH(efreet_icon_cache);
>
> +    if (fake_null)
> +    {
> +        efreet_icon_theme_free(fake_null);
> +        fake_null = NULL;
> +    }
> +
>     ecore_shutdown();
> }
>
> @@ -283,7 +291,7 @@
> {
>     Efreet_Icon_Theme *theme;
>
> -    if (!theme_name) return NULL;
> +    if (!theme_name) return fake_null;
>
>     theme = eina_hash_find(efreet_icon_themes, theme_name);
>     if (!theme)
> @@ -342,15 +350,23 @@
> efreet_icon_find_theme_check(const char *theme_name)
> {
>     Efreet_Icon_Theme *theme = NULL;
> -    if (!theme_name) return NULL;
> -    theme = efreet_icon_theme_find(theme_name);
> +    if (theme_name) theme = efreet_icon_theme_find(theme_name);
>     if (!theme)
>     {
> +        if ((fake_null) && (!theme_name)) return fake_null;
>         theme = efreet_icon_theme_new();
>         if (!theme) return NULL;
>         theme->fake = 1;
> -        theme->name.internal = eina_stringshare_add(theme_name);
> -        eina_hash_add(efreet_icon_themes, (void *)theme->name.internal, 
> theme);
> +        if (theme_name)
> +        {
> +            theme->name.internal = eina_stringshare_add(theme_name);
> +            eina_hash_add(efreet_icon_themes, (void *)theme->name.internal, 
> theme);
> +        }
> +        else
> +        {
> +            theme->name.internal = NULL;
> +            fake_null = theme;
> +        }
>     }
>
>     return theme;
> @@ -371,21 +387,18 @@
>
>     theme = efreet_icon_find_theme_check(theme_name);
>
> -    if (theme)
> +#ifdef SLOPPY_SPEC
>     {
> -#ifdef SLOPPY_SPEC
> -        {
> -            char *tmp;
> +        char *tmp;
>
> -            tmp = efreet_icon_remove_extension(icon);
> -            if (!tmp) return NULL;
> -            value = efreet_icon_find_helper(theme, tmp, size);
> -            FREE(tmp);
> -        }
> +        tmp = efreet_icon_remove_extension(icon);
> +        if (!tmp) return NULL;
> +        value = efreet_icon_find_helper(theme, tmp, size);
> +        FREE(tmp);
> +    }
> #else
> -        value = efreet_icon_find_helper(theme, icon, size);
> +    value = efreet_icon_find_helper(theme, 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
> @@ -419,27 +432,24 @@
>
>     theme = efreet_icon_find_theme_check(theme_name);
>
> -    if (theme)
> +#ifdef SLOPPY_SPEC
>     {
> -#ifdef SLOPPY_SPEC
> +        Eina_List *tmps = NULL;
> +
> +        EINA_LIST_FOREACH(icons, l, icon)
>         {
> -            Eina_List *tmps = NULL;
> +            data = efreet_icon_remove_extension(icon);
> +            if (!data) return NULL;
> +            tmps = eina_list_append(tmps, data);
> +        }
>
> -            EINA_LIST_FOREACH(icons, l, icon)
> -            {
> -                data = efreet_icon_remove_extension(icon);
> -                if (!data) return NULL;
> -                tmps = eina_list_append(tmps, data);
> -            }
> -
> -            value = efreet_icon_list_find_helper(theme, tmps, size);
> -            EINA_LIST_FREE(tmps, data)
> -                free(data);
> -        }
> +        value = efreet_icon_list_find_helper(theme, tmps, size);
> +        EINA_LIST_FREE(tmps, data)
> +            free(data);
> +    }
> #else
> -        value = efreet_icon_list_find_helper(theme, icons, size);
> +    value = efreet_icon_list_find_helper(theme, icons, size);
> #endif
> -    }
>
>     /* we didn't find the icons in the theme or in the inherited directories
>      * then just look for a non theme icon
> @@ -812,7 +822,7 @@
>     char *icon;
>
>     if (!icon_name) return NULL;
> -    icon = efreet_icon_cache_check(NULL, icon_name, 0);
> +    icon = efreet_icon_cache_check(efreet_icon_find_theme_check(NULL), 
> icon_name, 0);
>     if (icon) return icon;
>
>     icon = 
> efreet_icon_fallback_dir_scan(efreet_icon_deprecated_user_dir_get(), 
> icon_name);
> @@ -829,7 +839,7 @@
>             icon = efreet_icon_fallback_dir_scan(dir, icon_name);
>             if (icon)
>             {
> -                efreet_icon_cache_add(NULL, icon_name, 0, icon);
> +                efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), 
> icon_name, 0, icon);
>                 return icon;
>             }
>         }
> @@ -842,7 +852,7 @@
>             icon = efreet_icon_fallback_dir_scan(path, icon_name);
>             if (icon)
>             {
> -                efreet_icon_cache_add(NULL, icon_name, 0, icon);
> +                efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), 
> icon_name, 0, icon);
>                 return icon;
>             }
>         }
> @@ -853,7 +863,7 @@
>             icon = efreet_icon_fallback_dir_scan(path, icon_name);
>             if (icon)
>             {
> -                efreet_icon_cache_add(NULL, icon_name, 0, icon);
> +                efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), 
> icon_name, 0, icon);
>                 return icon;
>             }
>         }
> @@ -861,7 +871,7 @@
>         icon = efreet_icon_fallback_dir_scan("/usr/share/pixmaps", icon_name);
>     }
>
> -    efreet_icon_cache_add(NULL, icon_name, 0, icon);
> +    efreet_icon_cache_add(efreet_icon_find_theme_check(NULL), icon_name, 0, 
> icon);
>     return icon;
> }
>
> @@ -1607,8 +1617,6 @@
>     char key[4096];
>     struct stat st;
>
> -    if (!theme) theme = NON_EXISTING;
> -
>     list = eina_hash_find(efreet_icon_cache, theme);
>     if (!list) return NULL;
>
> @@ -1656,7 +1664,6 @@
>     else
>         cache->lasttime = ecore_time_get();
>
> -    if (!theme) theme = NON_EXISTING;
>     list = eina_hash_find(efreet_icon_cache, theme);
>     list = eina_list_prepend(list, cache);
>
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to