forked from enlightenment/enlightenment
Use new eina_list_search_sorted_near_list.
Match new api. By: Tiago Rezende Campos Falcão SVN revision: 41626
This commit is contained in:
parent
365d84efd2
commit
23d3ff38d9
|
@ -493,17 +493,15 @@ _e_theme_mappings_quickfind_free_cb(const Eina_Hash *hash, const void *key, void
|
||||||
static void
|
static void
|
||||||
_e_theme_category_register(const char *category)
|
_e_theme_category_register(const char *category)
|
||||||
{
|
{
|
||||||
const char *c;
|
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!categories)
|
if (!categories)
|
||||||
categories = eina_list_append(categories, eina_stringshare_add(category));
|
categories = eina_list_append(categories, eina_stringshare_add(category));
|
||||||
|
|
||||||
l = eina_list_search_sorted_near_list(categories, EINA_COMPARE_CB(strcmp), category);
|
l = eina_list_search_sorted_near_list(categories, EINA_COMPARE_CB(strcmp),
|
||||||
c = eina_list_data_get(l);
|
category, &ret);
|
||||||
|
|
||||||
ret = strcmp(c, category);
|
|
||||||
if (!ret) return;
|
if (!ret) return;
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
|
@ -541,22 +541,16 @@ _get_theme_categories_list(void)
|
||||||
EINA_LIST_FOREACH(e_theme_category_list(), g, c)
|
EINA_LIST_FOREACH(e_theme_category_list(), g, c)
|
||||||
{
|
{
|
||||||
const char *result;
|
const char *result;
|
||||||
|
int res;
|
||||||
|
|
||||||
if (!c) continue;
|
if (!c) continue;
|
||||||
|
|
||||||
cats2 = eina_list_search_sorted_near_list(cats, _cb_sort, c);
|
cats2 = eina_list_search_sorted_near_list(cats, _cb_sort, c, &res);
|
||||||
result = eina_list_data_get(cats2);
|
if (!res) continue;
|
||||||
if (result)
|
if (res < 0)
|
||||||
{
|
cats = eina_list_prepend_relative_list(cats, eina_stringshare_ref(c), cats2);
|
||||||
int res;
|
else
|
||||||
|
cats = eina_list_append_relative_list(cats, eina_stringshare_ref(c), cats2);
|
||||||
res = strcmp(c, result);
|
|
||||||
if (!res) continue;
|
|
||||||
if (res < 0)
|
|
||||||
cats = eina_list_prepend_relative_list(cats, eina_stringshare_ref(c), cats2);
|
|
||||||
else
|
|
||||||
cats = eina_list_append_relative_list(cats, eina_stringshare_ref(c), cats2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FREE(cats, category)
|
EINA_LIST_FREE(cats, category)
|
||||||
|
|
Loading…
Reference in New Issue