[Genlist] Remove error abort code
authorTae-Hwan Kim <the81.kim@samsung.com>
Fri, 7 Jun 2013 13:48:10 +0000 (22:48 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 05:39:35 +0000 (14:39 +0900)
when "highligted" callback is called (_elm_genlist_item_state_update),
application can call elm_genlist_item_fields_update().
Then, it->content_objs can be updated.
So this ERR check is deprecaed. So before realize contents,  unrealize
all contents if contents exist.

Change-Id: Id6161cc928364c085117a812093cbcbe31318b76

src/lib/elm_genlist.c

index 902119f..02c71d8 100644 (file)
@@ -1400,6 +1400,44 @@ _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
 #endif
 
 static Eina_List *
+_item_content_unrealize(Elm_Gen_Item *it,
+                        Evas_Object *target,
+                        Eina_List **source,
+                        const char *parts)
+{
+   Eina_List *res = it->content_objs;
+
+   if (it->itc->func.content_get)
+     {
+        const Eina_List *l;
+        const char *key;
+        Evas_Object *ic = NULL;
+
+        EINA_LIST_FOREACH(*source, l, key)
+          {
+             if (parts && fnmatch(parts, key, FNM_PERIOD))
+               continue;
+
+             ic = edje_object_part_swallow_get(target, key);
+             if (ic)
+               {
+                  res = eina_list_remove(res, ic);
+                  edje_object_part_unswallow(target, ic);
+                  // FIXME: If parent-child relationship was broken before 'ic'
+                  // is deleted, freeze_pop will not be called. ex) elm_slider
+                  // If layout is used instead of edje, this problme can be
+                  // solved.
+                  if (0 != elm_widget_scroll_freeze_get(ic))
+                    elm_widget_scroll_freeze_pop(ic);
+                  evas_object_del(ic);
+               }
+          }
+     }
+
+   return res;
+}
+
+static Eina_List *
 _item_content_realize(Elm_Gen_Item *it,
                       Evas_Object *target,
                       Eina_List **source,
@@ -1780,9 +1818,9 @@ _item_realize(Elm_Gen_Item *it,
         _elm_genlist_item_state_update(it);
         _elm_genlist_item_index_update(it);
 
-        if (eina_list_count(it->content_objs) != 0)
-          ERR_ABORT("If you see this error, please notify us and we"
-                    "will fix it");
+        if (it->content_objs)
+          it->content_objs = _item_content_unrealize(it, VIEW(it),
+                                                     &it->contents, NULL);
 
         _item_text_realize(it, VIEW(it), &it->texts, NULL);
         it->content_objs =
@@ -4467,44 +4505,6 @@ _item_mode_content_unrealize(Elm_Gen_Item *it,
    return res;
 }
 
-static Eina_List *
-_item_content_unrealize(Elm_Gen_Item *it,
-                        Evas_Object *target,
-                        Eina_List **source,
-                        const char *parts)
-{
-   Eina_List *res = it->content_objs;
-
-   if (it->itc->func.content_get)
-     {
-        const Eina_List *l;
-        const char *key;
-        Evas_Object *ic = NULL;
-
-        EINA_LIST_FOREACH(*source, l, key)
-          {
-             if (parts && fnmatch(parts, key, FNM_PERIOD))
-               continue;
-
-             ic = edje_object_part_swallow_get(target, key);
-             if (ic)
-               {
-                  res = eina_list_remove(res, ic);
-                  edje_object_part_unswallow(target, ic);
-                  // FIXME: If parent-child relationship was broken before 'ic'
-                  // is deleted, freeze_pop will not be called. ex) elm_slider
-                  // If layout is used instead of edje, this problme can be
-                  // solved.
-                  if (0 != elm_widget_scroll_freeze_get(ic))
-                    elm_widget_scroll_freeze_pop(ic);
-                  evas_object_del(ic);
-               }
-          }
-     }
-
-   return res;
-}
-
 static Eina_Bool
 _item_block_recalc(Item_Block *itb,
                    int in,