aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Lira <larry@expertisesolutions.com.br>2018-06-07 18:50:48 -0300
committerLarry Lira <larry@expertisesolutions.com.br>2018-06-07 19:15:50 -0300
commit03e0310a82b440602c85424b36e1955e84c9ffab (patch)
tree7a3772bc29f25806a5d33ea339635f2cec724baf
parentelm: fix efl_model property_get and children_slice_get in views (diff)
downloadefl-devs/larrylira/modelfix.tar.gz
examples: fix efl_model parent loop adddevs/larrylira/modelfix
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_1.c6
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_2.c2
-rw-r--r--src/examples/elementary/efl_ui_view_list_example_3.c2
-rw-r--r--src/examples/elementary/fileviewlist.c4
-rw-r--r--src/examples/elementary/layout_model_connect.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/src/examples/elementary/efl_ui_view_list_example_1.c b/src/examples/elementary/efl_ui_view_list_example_1.c
index 529d44cc09..e3ca73d261 100644
--- a/src/examples/elementary/efl_ui_view_list_example_1.c
+++ b/src/examples/elementary/efl_ui_view_list_example_1.c
@@ -42,14 +42,14 @@ _unrealized_cb(void *data EINA_UNUSED, const Efl_Event *event)
}
*/
static Efl_Model*
-_make_model()
+_make_model(Evas_Object *win)
{
Eina_Value vtext;
Efl_Model_Item *model, *child;
unsigned int i, s;
char buf[256];
- model = efl_add_ref(EFL_MODEL_ITEM_CLASS, NULL);
+ model = efl_add(EFL_MODEL_ITEM_CLASS, win);
eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
for (i = 0; i < (NUM_ITEMS); i++)
@@ -80,7 +80,7 @@ elm_main(int argc, char **argv)
elm_win_autodel_set(win, EINA_TRUE);
- model = _make_model();
+ model = _make_model(win);
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
efl_ui_model_connect(factory, "signal/elm,state,%v", "odd_style");
diff --git a/src/examples/elementary/efl_ui_view_list_example_2.c b/src/examples/elementary/efl_ui_view_list_example_2.c
index 641d0a6300..de4d259962 100644
--- a/src/examples/elementary/efl_ui_view_list_example_2.c
+++ b/src/examples/elementary/efl_ui_view_list_example_2.c
@@ -43,7 +43,7 @@ elm_main(int argc, char **argv)
if (argv[1] != NULL) dirname = argv[1];
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
- model = efl_add_ref(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
+ model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
efl_ui_model_connect(factory, "efl.text", "filename");
efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
diff --git a/src/examples/elementary/efl_ui_view_list_example_3.c b/src/examples/elementary/efl_ui_view_list_example_3.c
index ece4e9ce02..9e7507fc9b 100644
--- a/src/examples/elementary/efl_ui_view_list_example_3.c
+++ b/src/examples/elementary/efl_ui_view_list_example_3.c
@@ -173,7 +173,7 @@ _make_model()
Efl_Model_Item *model, *child;
unsigned int i, len;
- model = efl_add_ref(EFL_MODEL_ITEM_CLASS, NULL);
+ model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR);
diff --git a/src/examples/elementary/fileviewlist.c b/src/examples/elementary/fileviewlist.c
index 39df4f87c0..716fdb3f79 100644
--- a/src/examples/elementary/fileviewlist.c
+++ b/src/examples/elementary/fileviewlist.c
@@ -54,8 +54,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(genlist);
- priv.filemodel = efl_add_ref(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
- priv.fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label"));
+ priv.filemodel = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
+ priv.fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label"));
elm_view_list_model_set(priv.fileview, priv.filemodel);
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, &priv);
diff --git a/src/examples/elementary/layout_model_connect.c b/src/examples/elementary/layout_model_connect.c
index e93b34437d..acc74bccb9 100644
--- a/src/examples/elementary/layout_model_connect.c
+++ b/src/examples/elementary/layout_model_connect.c
@@ -111,10 +111,10 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
if (argv[1] != NULL) dirname = argv[1];
else dirname = EFL_MODEL_TEST_FILENAME_PATH;
- priv->model = efl_add_ref(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname));
+ priv->model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
genlist = elm_genlist_add(win);
- priv->fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL));
+ priv->fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL));
elm_view_list_property_connect(priv->fileview, "filename", "elm.text");
elm_view_list_model_set(priv->fileview, priv->model);
_widget_init(genlist);