summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-12-08 13:18:37 +0000
committerTom Hacohen <tom@stosb.com>2015-12-08 13:18:37 +0000
commit47c02f50710977d2442f2f53df34b288c77e9e59 (patch)
tree471b2bf7b0337379a99526e1d72f21d5790ab3b8
parentdc65b1158e56d4bbb4706caa899d8d4f3583cd61 (diff)
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.
-rw-r--r--src/examples/genlist_example_05.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/examples/genlist_example_05.c b/src/examples/genlist_example_05.c
index 48fe58922..ee2f67888 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)
370 _button_add(list, fbox, "add child", _add_child_cb); 370 _button_add(list, fbox, "add child", _add_child_cb);
371 _button_add(list, fbox, "del item", _del_item_cb); 371 _button_add(list, fbox, "del item", _del_item_cb);
372 372
373
374 Node_Data *pdata = NULL; // data for the parent of the group
375 Elm_Object_Item *glg = NULL;
373 for (i = 0; i < N_ITEMS; i++) 376 for (i = 0; i < N_ITEMS; i++)
374 { 377 {
375 Elm_Object_Item *gli = NULL, *glg = NULL; 378 Elm_Object_Item *gli = NULL;
376 Node_Data *data = malloc(sizeof(*data)); // data for this item 379 Node_Data *data = malloc(sizeof(*data)); // data for this item
377 data->children = NULL; 380 data->children = NULL;
378 data->value = i; 381 data->value = i;
379 data->favorite = EINA_FALSE; 382 data->favorite = EINA_FALSE;
380 nitems++; 383 nitems++;
381 384
382 Node_Data *pdata = NULL; // data for the parent of the group
383
384 printf("creating item: #%d\n", data->value); 385 printf("creating item: #%d\n", data->value);
385 if (i % 3 == 0) 386 if (i % 3 == 0)
386 { 387 {