[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-devel
Subject:    [E-devel] [Patch] Tree support for elm_genlist_item_prepend() API.
From:       Daniel Juyung Seo <juyung.seo () samsung ! com>
Date:       2010-12-30 0:57:00
Message-ID: 006101cba7bc$777e0970$667a1c50$%seo () samsung ! com
[Download RAW message or body]

Hello,
I added tree feature support to elm_genlist_item_prepend() API.
(elm_genlist_item_append() already supports tree.)
This patch is tested with elementary_test -> Genlist Tree.
Please review this and apply it to upstream.

I'll send a successive patch for tree support in
elm_genlist_item_insert_before/after() APIs.
But it will break APIs and Raster accepted it. So I separated the patches.
Thanks.

Daniel Juyung Seo (SeoZ)

["elm_genlist.patch.txt" (text/plain)]

Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c	(revision 55776)
+++ src/lib/elm_genlist.c	(working copy)
@@ -2688,12 +2688,23 @@ elm_genlist_item_prepend(Evas_Object
    if (!wd) return NULL;
    if (!it) return NULL;
    if (!it->parent)
-     wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
+     {
+        wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it));
+        it->rel = NULL;
+     }
    else
      {
-        printf("FIXME: 12 tree not handled yet\n");
+        Elm_Genlist_Item *it2 = NULL;
+        Eina_List *ll = it->parent->items;
+        if (ll) it2 = ll->data;
+        it->parent->items = eina_list_prepend(it->parent->items, it);
+        if (!it2) it2 = it->parent;
+        wd->items =
+           eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it),
+                                        EINA_INLIST_GET(it2));
+        it->rel = it2;
+        it->rel->relcount++;
      }
-   it->rel = NULL;
    it->before = EINA_TRUE;
    _item_queue(wd, it);
    return it;


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl

_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic