tasn pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=47c02f50710977d2442f2f53df34b288c77e9e59

commit 47c02f50710977d2442f2f53df34b288c77e9e59
Author: Tom Hacohen <t...@stosb.com>
Date:   Tue Dec 8 13:18:37 2015 +0000

    Examples genlist 5: Fix children aspect of the test not working.
    
    This code is obviously wrong and could never have worked.
    The parent that is being kept between iterations is being overwritten on
    ever iteration, leading to the wrong result.
    
    CID1327358.
---
 src/examples/genlist_example_05.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/examples/genlist_example_05.c 
b/src/examples/genlist_example_05.c
index 48fe589..ee2f678 100644
--- a/src/examples/genlist_example_05.c
+++ b/src/examples/genlist_example_05.c
@@ -370,17 +370,18 @@ elm_main(int argc, char **argv)
    _button_add(list, fbox, "add child", _add_child_cb);
    _button_add(list, fbox, "del item", _del_item_cb);
 
+
+   Node_Data *pdata = NULL; // data for the parent of the group
+   Elm_Object_Item *glg = NULL;
    for (i = 0; i < N_ITEMS; i++)
      {
-        Elm_Object_Item *gli = NULL, *glg = NULL;
+        Elm_Object_Item *gli = NULL;
         Node_Data *data = malloc(sizeof(*data)); // data for this item
         data->children = NULL;
         data->value = i;
         data->favorite = EINA_FALSE;
         nitems++;
 
-        Node_Data *pdata = NULL; // data for the parent of the group
-
         printf("creating item: #%d\n", data->value);
         if (i % 3 == 0)
           {

-- 


Reply via email to