summaryrefslogtreecommitdiff
path: root/unsorted
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-04-30 13:50:19 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-01 10:39:01 -0700
commit4eebe1b884272bdbe60c96c6ceb6cf3b7423b0b5 (patch)
tree2b38162c3126c835225a071dafd53daef5b4844c /unsorted
parent41e3a6bc3d9bff08b4e2dc8dad8cfef3d3f0635a (diff)
elementary: quick fix for filemvc example.
Diffstat (limited to 'unsorted')
-rw-r--r--unsorted/elementary/filemvc.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/unsorted/elementary/filemvc.c b/unsorted/elementary/filemvc.c
index 92646a73..2b1e81d1 100644
--- a/unsorted/elementary/filemvc.c
+++ b/unsorted/elementary/filemvc.c
@@ -38,12 +38,12 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
38 efl_unref(priv->treemodel); 38 efl_unref(priv->treemodel);
39} 39}
40 40
41static Eina_Bool 41static int
42_filter_cb(void *data EINA_UNUSED, Eio_File *handler EINA_UNUSED, const Eina_File_Direct_Info *info) 42_filter_cb(void *data EINA_UNUSED, Eio_Model *model, Eina_File_Direct_Info *info)
43{ 43{
44 if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return EINA_TRUE; 44 if (info->type == EINA_FILE_DIR && info->path[info->name_start] != '.') return 1;
45 45
46 return EINA_FALSE; 46 return 0;
47} 47}
48 48
49static void 49static void
@@ -58,39 +58,14 @@ _list_selected_cb(void *data EINA_UNUSED, const Efl_Event *event)
58} 58}
59 59
60static void 60static void
61_promise_then(void *data, const Efl_Event *event)
62{
63 Efl_Model_Test_Filemvc_Data *priv = data;
64 char *path;
65 Eo *model;
66 Efl_Future_Event_Success* info = event->info;
67 Eina_Value* value = info->value;
68
69 eina_value_get(value, &path);
70 model = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(), eio_model_path_set(efl_added, path));
71 elm_view_list_model_set(priv->fileview, model);
72}
73
74static void
75_promise_error(void *data EINA_UNUSED, const Efl_Event* err EINA_UNUSED)
76{
77 printf("Promise error!\n");
78}
79
80static void
81_tree_selected_cb(void *data, const Efl_Event *event) 61_tree_selected_cb(void *data, const Efl_Event *event)
82{ 62{
83 Efl_Model_Test_Filemvc_Data *priv = data; 63 Efl_Model_Test_Filemvc_Data *priv = data;
84 Eo *child = event->info; 64 Eo *child = event->info;
85 Efl_Future *f;
86 65
87 printf("TREE selected model\n"); 66 printf("TREE selected model\n");
88 67
89 f = efl_model_property_get(child, "path"); 68 elm_view_list_model_set(priv->fileview, child);
90 efl_ref(f);
91 efl_future_then(f, &_promise_then, &_promise_error, NULL, priv);
92 efl_future_link(event->object, f);
93 efl_unref(f);
94} 69}
95 70
96static void 71static void
@@ -151,7 +126,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
151 126
152 //treemodel 127 //treemodel
153 priv.treemodel = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(), eio_model_path_set(efl_added, dirname)); 128 priv.treemodel = efl_add(EIO_MODEL_CLASS, efl_main_loop_get(), eio_model_path_set(efl_added, dirname));
154 eio_model_children_filter_set(priv.treemodel, _filter_cb, NULL); 129 eio_model_children_filter_set(priv.treemodel, NULL, _filter_cb, NULL);
155 130
156 //treeview 131 //treeview
157 genlist = elm_genlist_add(win); 132 genlist = elm_genlist_add(win);