optimize use of edje_file_collection_list in various e things, also remove erroneous changelog/news entries

SVN revision: 83584
This commit is contained in:
Mike Blumenkrantz 2013-02-04 08:38:46 +00:00
parent 324af69e29
commit 01257a8acc
6 changed files with 42 additions and 54 deletions

View File

@ -1,6 +1,6 @@
2013-02-02 Chidambar Zinnoury (ilLogict)
2013-02-04 Mike Blumenkrantz
* Music-control settings: add check changed.
* optimize use of edje_file_collection_list
2013-02-01 Mike Blumenkrantz

2
NEWS
View File

@ -54,7 +54,6 @@ Improvements:
- desktop environments,
- language,
- notification,
- music-control.
* Improve UI of desk settings.
* Add icons for gadcon settings.
* Improve strings of pager settings.
@ -82,6 +81,7 @@ Improvements:
* split out binding configs into separate config domain
* binding dialogs are now able to reset bindings to the system profile file bindings
* "No listable items" in Navigate menu is now clickable
* optimize use of edje_file_collection_list
Fixes:
* IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.

View File

@ -78,7 +78,7 @@ e_bg_shutdown(void)
EAPI const E_Config_Desktop_Background *
e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
{
Eina_List *l, *ll, *entries;
Eina_List *l, *entries;
E_Config_Desktop_Background *bg = NULL, *cfbg = NULL;
const char *bgfile = "";
char *entry;
@ -121,18 +121,17 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
if (eina_str_has_extension(bgfile, ".edj"))
{
entries = edje_file_collection_list(bgfile);
if (entries)
EINA_LIST_FREE(entries, entry)
{
EINA_LIST_FOREACH(entries, ll, entry)
if (!strcmp(entry, "e/desktop/background"))
{
if (!strcmp(entry, "e/desktop/background"))
{
bg = cfbg;
current_spec = spec;
}
bg = cfbg;
current_spec = spec;
break;
}
edje_file_collection_list_free(entries);
eina_stringshare_del(entry);
}
E_FREE_LIST(entries, eina_stringshare_del);
}
else
{

View File

@ -1979,9 +1979,10 @@ _e_fm2_icon_thumb_edje_get(Evas *evas, const E_Fm2_Icon *ic, Evas_Smart_Cb cb, v
group = eina_stringshare_add(*itr);
else
{
Eina_List *l = edje_file_collection_list(buf);
if (!l) return NULL;
group = eina_stringshare_add(eina_list_data_get(l));
Eina_List *l;
l = edje_file_collection_list(buf);
group = eina_stringshare_ref(eina_list_data_get(l));
edje_file_collection_list_free(l);
}
if (!group) return NULL;

View File

@ -164,7 +164,6 @@ _e_theme_edje_file_get(const char *category, const char *group, Eina_Bool fallba
{
E_Theme_Result *res;
char buf[4096];
const char *q;
char *p;
/* find category -> edje mapping */
@ -196,7 +195,7 @@ _e_theme_edje_file_get(const char *category, const char *group, Eina_Bool fallba
if (str)
{
void *tres;
Eina_List *coll, *l;
Eina_List *coll;
int ok;
snprintf(buf, sizeof(buf), "%s/::/%s", str, group);
@ -206,18 +205,14 @@ _e_theme_edje_file_get(const char *category, const char *group, Eina_Bool fallba
/* if the group exists - return */
if (!res->quickfind)
{
const char *col;
Eina_Stringshare *col;
res->quickfind = eina_hash_string_superfast_new(NULL);
/* create a quick find hash of all group entries */
coll = edje_file_collection_list(str);
EINA_LIST_FOREACH(coll, l, col)
{
q = eina_stringshare_add(col);
eina_hash_direct_add(res->quickfind, q, q);
}
if (coll) edje_file_collection_list_free(coll);
EINA_LIST_FREE(coll, col)
eina_hash_direct_add(res->quickfind, col, col);
}
/* save in the group cache hash */
if (eina_hash_find(res->quickfind, group))
@ -660,33 +655,28 @@ _e_theme_collection_items_find(const char *base, const char *collname)
}
if (str)
{
Eina_List *coll, *l;
Eina_List *coll;
Eina_Stringshare *c;
int collname_len;
coll = edje_file_collection_list(str);
if (coll)
if (coll) collname_len = strlen(collname);
EINA_LIST_FREE(coll, c)
{
const char *c;
int collname_len;
collname_len = strlen(collname);
EINA_LIST_FOREACH(coll, l, c)
if (!strncmp(c, collname, collname_len))
{
if (!strncmp(c, collname, collname_len))
{
char *trans, *p2;
char *trans, *p2;
trans = strdup(c);
p = trans + collname_len + 1;
if (*p)
{
p2 = strchr(p, '/');
if (p2) *p2 = 0;
list = _e_theme_collection_item_register(list, p);
}
free(trans);
trans = strdupa(c);
p = trans + collname_len + 1;
if (*p)
{
p2 = strchr(p, '/');
if (p2) *p2 = 0;
list = _e_theme_collection_item_register(list, p);
}
}
edje_file_collection_list_free(coll);
eina_stringshare_del(c);
}
}
}

View File

@ -666,20 +666,18 @@ e_util_desk_border_below(E_Border *bd)
EAPI int
e_util_edje_collection_exists(const char *file, const char *coll)
{
Eina_List *clist, *l;
char *str;
Eina_List *clist;
Eina_Stringshare *str;
Eina_Bool ret = EINA_FALSE;
clist = edje_file_collection_list(file);
EINA_LIST_FOREACH(clist, l, str)
EINA_LIST_FREE(clist, str)
{
if (!strcmp(coll, str))
{
edje_file_collection_list_free(clist);
return 1;
}
if ((!ret) && (!strcmp(coll, str)))
ret = EINA_TRUE;
eina_stringshare_del(str);
}
edje_file_collection_list_free(clist);
return 0;
return ret;
}
EAPI E_Dialog *