aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/temperature/e_mod_main.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2007-09-16 10:55:16 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2007-09-16 10:55:16 +0000
commit1554f92345df28334e3920fcc846b926554e3da4 (patch)
tree9d8d57e704dbb5fd987e8228e279dba6dd3afff2 /src/modules/temperature/e_mod_main.c
parentsimplify (diff)
downloadenlightenment-1554f92345df28334e3920fcc846b926554e3da4.tar.gz
Only search once per session.
SVN revision: 31739
Diffstat (limited to 'src/modules/temperature/e_mod_main.c')
-rw-r--r--src/modules/temperature/e_mod_main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c
index bbf7f6bf0..a0cdcf2c1 100644
--- a/src/modules/temperature/e_mod_main.c
+++ b/src/modules/temperature/e_mod_main.c
@@ -49,6 +49,8 @@ static Evas_Bool _temperature_face_id_max(Evas_Hash *hash, const char *key, void
static E_Config_DD *conf_edd = NULL;
static E_Config_DD *conf_face_edd = NULL;
+static int uuid = 0;
+
static Config *temperature_config = NULL;
static E_Gadcon_Client *
@@ -150,10 +152,8 @@ _gc_id_new(void)
{
Config_Face *inst;
char id[128];
- int num = 0;
- evas_hash_foreach(temperature_config->faces, _temperature_face_id_max, &num);
- snprintf(id, sizeof(id), "%s.%d", _gadcon_class.name, num + 1);
+ snprintf(id, sizeof(id), "%s.%d", _gadcon_class.name, ++uuid);
inst = E_NEW(Config_Face, 1);
inst->id = evas_stringshare_add(id);
@@ -581,7 +581,7 @@ _temperature_face_id_max(Evas_Hash *hash, const char *key, void *hdata, void *fd
int *max;
int num = -1;
- max = (int *)fdata;
+ max = fdata;
p = strrchr(key, '.');
if (p) num = atoi(p + 1);
if (num > *max) *max = num;
@@ -692,6 +692,10 @@ e_modapi_init(E_Module *m)
{
temperature_config = E_NEW(Config, 1);
}
+ else
+ {
+ evas_hash_foreach(temperature_config->faces, _temperature_face_id_max, &uuid);
+ }
temperature_config->module = m;
e_gadcon_provider_register(&_gadcon_class);