summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-05 20:53:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-06 09:43:19 +0900
commit4e811bed17a33b78b13df2a479290caf49930ceb (patch)
tree70c55667ed6b6af7f04258cc60e3df811302b583 /src/lib/eio
parenta9eb2303fba225bcffbb7940a5b35bbd425a48f1 (diff)
eio_model: Provide main loop even without parent
An eio model (and I believe most other models as well, in fact) require a Efl.Loop.User as parent in order for efl future/promises to work. This adds a fallback code directly inside eio model. The alternative was to parent and efl_del all models in fileselector. See T4686
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_model.c14
-rw-r--r--src/lib/eio/eio_model.eo1
2 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/eio_model.c
index 56395b7cec..64a7213ac6 100644
--- a/src/lib/eio/eio_model.c
+++ b/src/lib/eio/eio_model.c
@@ -703,7 +703,6 @@ _eio_model_efl_object_destructor(Eo *obj , Eio_Model_Data *priv)
703 efl_destructor(efl_super(obj, MY_CLASS)); 703 efl_destructor(efl_super(obj, MY_CLASS));
704} 704}
705 705
706
707static Eo * 706static Eo *
708_eio_model_efl_object_parent_get(Eo *obj , Eio_Model_Data *priv) 707_eio_model_efl_object_parent_get(Eo *obj , Eio_Model_Data *priv)
709{ 708{
@@ -723,4 +722,17 @@ _eio_model_efl_object_parent_get(Eo *obj , Eio_Model_Data *priv)
723 } 722 }
724 return model; 723 return model;
725} 724}
725
726EOLIAN static Eo *
727_eio_model_efl_object_provider_find(Eo *obj, Eio_Model_Data *priv EINA_UNUSED, const Efl_Class *klass)
728{
729 Eo *provider = efl_provider_find(efl_super(obj, MY_CLASS), klass);
730
731 // Provide main loop even if we don't have a loop user parent
732 if (!provider && (klass == EFL_LOOP_CLASS) && eina_main_loop_is())
733 return ecore_main_loop_get();
734
735 return provider;
736}
737
726#include "eio_model.eo.c" 738#include "eio_model.eo.c"
diff --git a/src/lib/eio/eio_model.eo b/src/lib/eio/eio_model.eo
index 5cbde595a4..bc4d4b69af 100644
--- a/src/lib/eio/eio_model.eo
+++ b/src/lib/eio/eio_model.eo
@@ -37,6 +37,7 @@ class Eio.Model (Efl.Object, Efl.Model)
37 Efl.Object.constructor; 37 Efl.Object.constructor;
38 Efl.Object.destructor; 38 Efl.Object.destructor;
39 Efl.Object.parent.get; 39 Efl.Object.parent.get;
40 Efl.Object.provider_find;
40 Efl.Model.properties.get; 41 Efl.Model.properties.get;
41 Efl.Model.property_set; 42 Efl.Model.property_set;
42 Efl.Model.property_get; 43 Efl.Model.property_get;