Hi, I modified the two uses of the eina_list_search_sorted_near_list in the
e. Someone could apply the patch please?

Thanks

-- 
Tiago Rezende Campos Falcão
Developer @ ProFUSION Embedded Systems
From 57037100f3f13f4171c240f14e387d08da9ef210 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Tiago=20Rezende=20Campos=20Falc=C3=A3o?= <ti...@ivanka.(none)>
Date: Thu, 6 Aug 2009 17:08:24 -0300
Subject: [PATCH] Use new eina_list_search_sorted_near_list

---
 src/bin/e_theme.c                           |    6 ++----
 src/modules/conf_theme/e_int_config_theme.c |   20 +++++++-------------
 2 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/src/bin/e_theme.c b/src/bin/e_theme.c
index 5073ecd..0b237ab 100644
--- a/src/bin/e_theme.c
+++ b/src/bin/e_theme.c
@@ -493,17 +493,15 @@ _e_theme_mappings_quickfind_free_cb(const Eina_Hash *hash, const void *key, void
 static void
 _e_theme_category_register(const char *category)
 {
-   const char *c;
    Eina_List *l;
    int ret;
 
    if (!categories)
      categories = eina_list_append(categories, eina_stringshare_add(category));
 
-   l = eina_list_search_sorted_near_list(categories, EINA_COMPARE_CB(strcmp), category);
-   c = eina_list_data_get(l);
+   l = eina_list_search_sorted_near_list(categories, EINA_COMPARE_CB(strcmp),
+         category, &ret);
 
-   ret = strcmp(c, category);
    if (!ret) return;
 
    if (ret < 0)
diff --git a/src/modules/conf_theme/e_int_config_theme.c b/src/modules/conf_theme/e_int_config_theme.c
index cf61fb7..d759eb4 100644
--- a/src/modules/conf_theme/e_int_config_theme.c
+++ b/src/modules/conf_theme/e_int_config_theme.c
@@ -541,22 +541,16 @@ _get_theme_categories_list(void)
    EINA_LIST_FOREACH(e_theme_category_list(), g, c)
      {
 	const char *result;
+	int res;
 
 	if (!c) continue;
 
-	cats2 = eina_list_search_sorted_near_list(cats, _cb_sort, c);
-	result = eina_list_data_get(cats2);
-	if (result)
-	  {
-	     int res;
-
-	     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);
-	  }
+	cats2 = eina_list_search_sorted_near_list(cats, _cb_sort, c, &res);
+	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)
-- 
1.6.0.4

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to