summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-19 16:10:34 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-19 16:17:47 +0200
commitbcb0ac27e834fbd0b6fb0932a8734ff529a335bb (patch)
tree17271027977174cde7f901b5011d8c4e91b915bf
parent5cf3d3b23aa3f5164d14db63a35def98a0c7f824 (diff)
efl_io_model: remove custom counting logicdevs/bu5hm4n/work_eio
this logic brings a few problems: - When files are annonced here, without the monitor having the context of the files, immidiat actions like deletion of the file are resulting in no deletion event. Which is definitly a bug, so we need to wait here for the monitor. - When a new count is annonced before the files are there from the monitor, we are heading towards the same issue - additionally, we might already have files available, due to the custom counting that are not annoncned through the monitor, which means, at a later pointer we are annoncing a new file which is already available via the API. Right now i do not see a way to continue with this code, it caused major issues with our CI and the POLL backend, for now things do work again. Differential Revision: https://phab.enlightenment.org/D9625
-rw-r--r--src/lib/eio/efl_io_model.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/lib/eio/efl_io_model.c b/src/lib/eio/efl_io_model.c
index 824a27c8a8..a73a37a5f3 100644
--- a/src/lib/eio/efl_io_model.c
+++ b/src/lib/eio/efl_io_model.c
@@ -755,63 +755,6 @@ _efl_io_model_efl_model_property_set(Eo *obj,
755 return efl_loop_future_rejected(obj, err); 755 return efl_loop_future_rejected(obj, err);
756} 756}
757 757
758static void
759_efl_io_model_children_list(void *data, Eina_Array *entries)
760{
761 Eina_File_Direct_Info *info;
762 Efl_Model *obj = data;
763 Efl_Io_Model_Data *pd;
764 Efl_Model_Children_Event cevt = { 0 };
765 Eina_Array_Iterator iterator;
766 unsigned int i;
767
768 pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS);
769 if (!pd) return ;
770
771 EINA_ARRAY_ITER_NEXT(entries, i, info, iterator)
772 {
773 Efl_Io_Model_Info *mi;
774
775 if (_already_added(pd, info->path)) continue;
776
777 if (pd->filter.cb)
778 {
779 if (!pd->filter.cb(pd->filter.data, obj, info))
780 continue ;
781 }
782
783 mi = calloc(1, sizeof (Efl_Io_Model_Info));
784 if (!mi) continue ;
785
786 mi->path_length = info->path_length;
787 mi->path = eina_stringshare_add(info->path);
788
789 mi->name_start = info->name_start;
790 mi->name_length = info->name_length;
791 mi->type = _efl_io_model_info_type_get(info, NULL);
792 mi->parent_ref = EINA_FALSE;
793 mi->child_ref = EINA_TRUE;
794
795 cevt.index = eina_list_count(pd->files);
796 cevt.child = NULL;
797
798 pd->files = eina_list_append(pd->files, mi);
799
800 efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
801 }
802
803 efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
804}
805
806static void
807_efl_io_model_children_list_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
808{
809 Efl_Io_Model_Data *pd = data;
810
811 pd->request.listing = NULL;
812 pd->listed = EINA_TRUE;
813}
814
815/** 758/**
816 * Children Count Get 759 * Children Count Get
817 */ 760 */
@@ -828,30 +771,6 @@ _efl_io_model_efl_model_children_count_get(const Eo *obj, Efl_Io_Model_Data *pd)
828 { 771 {
829 _eio_build_st(obj, pd); 772 _eio_build_st(obj, pd);
830 } 773 }
831 else if (!pd->listed &&
832 !pd->request.listing &&
833 pd->info->type == EINA_FILE_DIR)
834 {
835 Efl_Io_Manager *iom;
836 Eina_Future *f;
837
838 iom = efl_provider_find(obj, EFL_IO_MANAGER_CLASS);
839 if (!iom)
840 {
841 ERR("Could not find an Efl.Io.Manager on %p.", obj);
842 return 0;
843 }
844
845 f = efl_io_manager_direct_ls(iom, pd->path, EINA_FALSE,
846 (void*) obj, _efl_io_model_children_list, NULL);
847
848 //start monitoring before listing is done
849 //we will filter later on if we already published a file or not
850 _efl_io_model_efl_model_monitor_add(pd);
851 pd->request.listing = efl_future_then(obj, f,
852 .free = _efl_io_model_children_list_cleanup,
853 .data = pd);
854 }
855 774
856 return eina_list_count(pd->files); 775 return eina_list_count(pd->files);
857} 776}