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)
downloadelementary-47c02f50710977d2442f2f53df34b288c77e9e59.tar.gz
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)
_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)
{