Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_icon_theme.c
Log Message:
- cache unsuccessful icon lookups
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon_theme.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_icon_theme.c 25 Sep 2006 05:03:27 -0000 1.6
+++ ewl_icon_theme.c 26 Sep 2006 05:12:54 -0000 1.7
@@ -3,6 +3,8 @@
#include "ewl_macros.h"
#include "ewl_private.h"
+#define NOMATCH ((char *)0xdeadbeef)
+
static int ewl_icon_theme_is_edje = 0;
static Ecore_Hash *ewl_icon_theme_cache = NULL;
@@ -82,7 +84,7 @@
const char *
ewl_icon_theme_icon_path_get(const char *icon, const char *size)
{
- const char *ret;
+ char *ret;
const char *icon_size;
char key[256];
@@ -109,8 +111,13 @@
ret = ecore_desktop_icon_find(icon, icon_size,
ewl_config.theme.icon.theme);
- ecore_hash_set(ewl_icon_theme_cache, strdup(key), (void *)ret);
+ if (!ret) ret = NOMATCH;
+
+ ecore_hash_set(ewl_icon_theme_cache, strdup(key), ret);
}
+
+ if (ret == NOMATCH)
+ ret = NULL;
DRETURN_PTR(ret, DLEVEL_STABLE);
}
@@ -119,6 +126,9 @@
ewl_icon_theme_cb_free(void *data)
{
DENTER_FUNCTION(DLEVEL_STABLE);
+
+ if (data == NOMATCH)
+ DRETURN(DLEVEL_STABLE);
IF_FREE(data);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs