[Genlist] Remove contents eventhouhgh content get retruns NULL.
authorTae-Hwan Kim <the81.kim@samsung.com>
Mon, 29 Jul 2013 11:40:09 +0000 (20:40 +0900)
committerTae-Hwan Kim <the81.kim@samsung.com>
Wed, 31 Jul 2013 08:03:17 +0000 (17:03 +0900)
So application can remove the contents by using NULL

Change-Id: Ibd2957805f6ac39757ed1cd379fa12d184b18463

src/lib/elm_genlist.c

index acf0480..1da0633 100644 (file)
@@ -665,18 +665,18 @@ _item_content_realize(Elm_Gen_Item *it,
              if (parts && fnmatch(parts, key, FNM_PERIOD))
                continue;
 
+             Evas_Object *old = edje_object_part_swallow_get(target, key);
+             if (old)
+               {
+                  contents = eina_list_remove(contents, old);
+                  evas_object_del(old);
+               }
+
              if (it->itc->func.content_get)
                ic = it->itc->func.content_get
                    ((void *)it->base.data, WIDGET(it), key);
              if (ic)
                {
-                  Evas_Object *c = edje_object_part_swallow_get(target, key);
-                  if (c)
-                    {
-                       contents = eina_list_remove(contents, c);
-                       evas_object_del(c);
-                    }
-
                   if (!edje_object_part_swallow(target, key, ic))
                     {
                       WRN("%s (%p) can not be swallowed into %s",