summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-11-07 11:53:15 -0800
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-07 22:24:08 +0100
commit1f66d9ed9b6eb5df09f66230e364197ccead00f5 (patch)
treef62d8eb0b5589a02d024ff8a745f7e4d5b92d603 /src
parent620dd43db201cb5b24899c8f1e0bc3582f3e867e (diff)
elementary: watch event on the model Efl.Ui.CollectionView use directly.
Efl.Model can be nested and Efl.Ui.CollectionView use this ability. Listening on the nested model instead of the nester model can lead to event being triggered that shouldn't. Better listen on the top model. Differential Revision: https://phab.enlightenment.org/D10621
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index c08ae16..16680e8 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -1884,12 +1884,10 @@ _efl_ui_collection_view_model_changed(void *data, const Efl_Event *event)
1884 Efl_Model *mselect = NULL; 1884 Efl_Model *mselect = NULL;
1885 Eina_Bool selection = EINA_FALSE, sizing = EINA_FALSE; 1885 Eina_Bool selection = EINA_FALSE, sizing = EINA_FALSE;
1886 1886
1887 if (ev->previous) efl_event_callback_array_del(ev->previous, model_cbs(), data);
1888 if (ev->current) efl_event_callback_array_add(ev->current, model_cbs(), data);
1889
1890 // Cleanup all object, pending request and refetch everything 1887 // Cleanup all object, pending request and refetch everything
1891 _all_cleanup(data, pd); 1888 _all_cleanup(data, pd);
1892 1889
1890 if (pd->model) efl_event_callback_array_del(pd->model, model_cbs(), data);
1893 efl_replace(&pd->model, NULL); 1891 efl_replace(&pd->model, NULL);
1894 1892
1895 if (!ev->current) 1893 if (!ev->current)
@@ -1983,6 +1981,8 @@ _efl_ui_collection_view_model_changed(void *data, const Efl_Event *event)
1983 requests = _batch_request_flush(requests, data, pd); 1981 requests = _batch_request_flush(requests, data, pd);
1984 1982
1985 pd->model = model; 1983 pd->model = model;
1984 efl_event_callback_array_add(pd->model, model_cbs(), data);
1985
1986 efl_ui_position_manager_entity_item_size_changed(pd->manager, 0, count - 1); 1986 efl_ui_position_manager_entity_item_size_changed(pd->manager, 0, count - 1);
1987 switch(efl_ui_position_manager_entity_version(pd->manager, 1)) 1987 switch(efl_ui_position_manager_entity_version(pd->manager, 1))
1988 { 1988 {
@@ -1993,8 +1993,6 @@ _efl_ui_collection_view_model_changed(void *data, const Efl_Event *event)
1993 count); 1993 count);
1994 break; 1994 break;
1995 } 1995 }
1996
1997
1998} 1996}
1999 1997
2000static void 1998static void