summaryrefslogtreecommitdiff
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
parent0dfadc232254d167b8180c93e3d7cb15e643488d (diff)
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)
42} 42}
43*/ 43*/
44static Efl_Model* 44static Efl_Model*
45_make_model() 45_make_model(Evas_Object *win)
46{ 46{
47 Eina_Value vtext; 47 Eina_Value vtext;
48 Efl_Model_Item *model, *child; 48 Efl_Model_Item *model, *child;
49 unsigned int i, s; 49 unsigned int i, s;
50 char buf[256]; 50 char buf[256];
51 51
52 model = efl_add_ref(EFL_MODEL_ITEM_CLASS, NULL); 52 model = efl_add(EFL_MODEL_ITEM_CLASS, win);
53 eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING); 53 eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
54 54
55 for (i = 0; i < (NUM_ITEMS); i++) 55 for (i = 0; i < (NUM_ITEMS); i++)
@@ -80,7 +80,7 @@ elm_main(int argc, char **argv)
80 80
81 elm_win_autodel_set(win, EINA_TRUE); 81 elm_win_autodel_set(win, EINA_TRUE);
82 82
83 model = _make_model(); 83 model = _make_model(win);
84 84
85 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); 85 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
86 efl_ui_model_connect(factory, "signal/elm,state,%v", "odd_style"); 86 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)
43 if (argv[1] != NULL) dirname = argv[1]; 43 if (argv[1] != NULL) dirname = argv[1];
44 else dirname = EFL_MODEL_TEST_FILENAME_PATH; 44 else dirname = EFL_MODEL_TEST_FILENAME_PATH;
45 45
46 model = efl_add_ref(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname)); 46 model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
47 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); 47 factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
48 efl_ui_model_connect(factory, "efl.text", "filename"); 48 efl_ui_model_connect(factory, "efl.text", "filename");
49 efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default"); 49 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()
173 Efl_Model_Item *model, *child; 173 Efl_Model_Item *model, *child;
174 unsigned int i, len; 174 unsigned int i, len;
175 175
176 model = efl_add_ref(EFL_MODEL_ITEM_CLASS, NULL); 176 model = efl_add(EFL_MODEL_ITEM_CLASS, efl_main_loop_get());
177 eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING); 177 eina_value_setup(&vtext, EINA_VALUE_TYPE_STRING);
178 eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR); 178 eina_value_setup(&value, EINA_VALUE_TYPE_UCHAR);
179 179
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)
54 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 54 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
55 evas_object_show(genlist); 55 evas_object_show(genlist);
56 56
57 priv.filemodel = efl_add_ref(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname)); 57 priv.filemodel = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
58 priv.fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label")); 58 priv.fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_TREE, "double_label"));
59 elm_view_list_model_set(priv.fileview, priv.filemodel); 59 elm_view_list_model_set(priv.fileview, priv.filemodel);
60 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, &priv); 60 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, &priv);
61 61
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)
111 if (argv[1] != NULL) dirname = argv[1]; 111 if (argv[1] != NULL) dirname = argv[1];
112 else dirname = EFL_MODEL_TEST_FILENAME_PATH; 112 else dirname = EFL_MODEL_TEST_FILENAME_PATH;
113 113
114 priv->model = efl_add_ref(EIO_MODEL_CLASS, NULL, eio_model_path_set(efl_added, dirname)); 114 priv->model = efl_add(EIO_MODEL_CLASS, win, eio_model_path_set(efl_added, dirname));
115 115
116 genlist = elm_genlist_add(win); 116 genlist = elm_genlist_add(win);
117 priv->fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, NULL, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL)); 117 priv->fileview = efl_add(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL));
118 elm_view_list_property_connect(priv->fileview, "filename", "elm.text"); 118 elm_view_list_property_connect(priv->fileview, "filename", "elm.text");
119 elm_view_list_model_set(priv->fileview, priv->model); 119 elm_view_list_model_set(priv->fileview, priv->model);
120 _widget_init(genlist); 120 _widget_init(genlist);