elm genlist: Refactoring. Moved code for the readability.
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 2 Aug 2011 06:59:45 +0000 (06:59 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 2 Aug 2011 06:59:45 +0000 (06:59 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@61983 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_genlist.c

index 4031c58..2145459 100644 (file)
@@ -3454,6 +3454,47 @@ elm_genlist_item_prepend(Evas_Object                  *obj,
 }
 
 EAPI Elm_Genlist_Item *
+elm_genlist_item_insert_after(Evas_Object                  *obj,
+                              const Elm_Genlist_Item_Class *itc,
+                              const void                   *data,
+                              Elm_Genlist_Item             *parent,
+                              Elm_Genlist_Item             *after,
+                              Elm_Genlist_Item_Flags        flags,
+                              Evas_Smart_Cb                 func,
+                              const void                   *func_data)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+   Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
+                                    func_data);
+   if (!it) return NULL;
+   /* It makes no sense to insert after in an empty list with after != NULL, something really bad is happening in your app. */
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
+
+   if (!it->parent)
+     {
+        if ((flags & ELM_GENLIST_ITEM_GROUP) &&
+            (after->flags & ELM_GENLIST_ITEM_GROUP))
+          wd->group_items = eina_list_append_relative(wd->group_items, it,
+                                                      after);
+     }
+   else
+     {
+        it->parent->items = eina_list_append_relative(it->parent->items, it,
+                                                      after);
+     }
+   wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
+                                           EINA_INLIST_GET(after));
+   it->rel = after;
+   it->rel->relcount++;
+   it->before = EINA_FALSE;
+   _item_queue(wd, it);
+   return it;
+}
+
+EAPI Elm_Genlist_Item *
 elm_genlist_item_insert_before(Evas_Object                  *obj,
                                const Elm_Genlist_Item_Class *itc,
                                const void                   *data,
@@ -3587,47 +3628,6 @@ elm_genlist_item_sorted_insert(Evas_Object                  *obj,
                                                 _elm_genlist_item_compare_data, func, func_data);
 }
 
-EAPI Elm_Genlist_Item *
-elm_genlist_item_insert_after(Evas_Object                  *obj,
-                              const Elm_Genlist_Item_Class *itc,
-                              const void                   *data,
-                              Elm_Genlist_Item             *parent,
-                              Elm_Genlist_Item             *after,
-                              Elm_Genlist_Item_Flags        flags,
-                              Evas_Smart_Cb                 func,
-                              const void                   *func_data)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(after, NULL);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd) return NULL;
-   Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
-                                    func_data);
-   if (!it) return NULL;
-   /* It makes no sense to insert after in an empty list with after != NULL, something really bad is happening in your app. */
-   EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
-
-   if (!it->parent)
-     {
-        if ((flags & ELM_GENLIST_ITEM_GROUP) &&
-            (after->flags & ELM_GENLIST_ITEM_GROUP))
-          wd->group_items = eina_list_append_relative(wd->group_items, it,
-                                                      after);
-     }
-   else
-     {
-        it->parent->items = eina_list_append_relative(it->parent->items, it,
-                                                      after);
-     }
-   wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
-                                           EINA_INLIST_GET(after));
-   it->rel = after;
-   it->rel->relcount++;
-   it->before = EINA_FALSE;
-   _item_queue(wd, it);
-   return it;
-}
-
 EAPI void
 elm_genlist_clear(Evas_Object *obj)
 {