Edje_File *edf;
Edje_Part_Collection *edc;
Eet_File *ef;
+ Evas_List *l;
ef = eet_open(file, EET_FILE_MODE_READ);
if (!ef)
edf->references = 1;
_edje_textblock_style_parse_and_fix(edf);
+
+ for (l = edf->data; l; l = evas_list_remove(l, l->data))
+ {
+ Edje_Data *di = l->data;
+ edf->data_cache = evas_hash_add(edf->data_cache, evas_stringshare_add(di->key), di->value);
+ free(di);
+ }
+ edf->data = NULL;
if (!coll)
{
if (edc_ret) *edc_ret = edc;
eet_close(ef);
+
return edf;
}
char *str = NULL;
int error_ret = 0;
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
- if (edf != NULL)
+ if (key)
{
- for (l = edf->data; l; l = l->next)
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
+ if ((edf != NULL) && (edf->data_cache != NULL))
{
- Edje_Data *di;
-
- di = l->data;
- if ((di->key) && (key) && (!strcmp(di->key, key)))
- {
- if (!di->value) return NULL;
- str = strdup(di->value);
- break;
- }
-
+ str = evas_hash_find(edf->data_cache, key);
+ if (str) str = strdup(str);
+ _edje_cache_file_unref(edf);
}
- _edje_cache_file_unref(edf);
}
return str;
}
ed->table_programs = NULL;
ed->table_programs_size = 0;
}
+/**
+ * Used to free the cached data values that are stored in the data_cache
+ * hash table.
+ */
+static Evas_Bool data_cache_free(Evas_Hash *hash, const char *key,
+ void *data, void *fdata)
+{
+ evas_stringshare_del(data);
+
+ return 1;
+}
+
+
void
_edje_file_free(Edje_File *edf)
if (edt->value) evas_stringshare_del(edt->value);
free(edt);
}
-
+ if (edf->data_cache)
+ {
+ evas_hash_foreach(edf->data_cache, data_cache_free, NULL);
+ evas_hash_free(edf->data_cache);
+ edf->data_cache = NULL;
+ }
+
while (edf->color_classes)
{
Edje_Color_Class *ecc;