summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-11-07 11:53:15 -0800
committerMike Blumenkrantz <zmike@samsung.com>2019-11-27 09:42:53 -0500
commit0c3013d4ab316dd292fbf9e635102d2d32359410 (patch)
tree339d1b46a23454735f4be15c77c329a2ae107097
parent1b68867ef14de0b7f2c6b62c172d8ffeb99e738a (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
-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 c08ae16dba..16680e8d47 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