summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eio/eio_model.c42
-rw-r--r--src/lib/eio/eio_model_private.h1
2 files changed, 40 insertions, 3 deletions
diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/eio_model.c
index 9baec99..3b3c2be 100644
--- a/src/lib/eio/eio_model.c
+++ b/src/lib/eio/eio_model.c
@@ -331,6 +331,19 @@ _eio_build_st_done(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *s
331} 331}
332 332
333static void 333static void
334_eio_build_st_done_clobber(void *data, Eio_File *handler, const Eina_Stat *stat)
335{
336 Eio_Model *model = data;
337 Eio_Model *parent;
338
339 efl_ref(model);
340 _eio_build_st_done(data, handler, stat);
341 parent = efl_parent_get(model);
342 efl_model_child_del(parent, model);
343 efl_unref(model);
344}
345
346static void
334_eio_build_st_error(void *data, Eio_File *handler EINA_UNUSED, int error) 347_eio_build_st_error(void *data, Eio_File *handler EINA_UNUSED, int error)
335{ 348{
336 Eio_Model *model = data; 349 Eio_Model *model = data;
@@ -345,6 +358,19 @@ _eio_build_st_error(void *data, Eio_File *handler EINA_UNUSED, int error)
345} 358}
346 359
347static void 360static void
361_eio_build_st_error_clobber(void *data, Eio_File *handler, int error)
362{
363 Eio_Model *model = data;
364 Eio_Model *parent;
365
366 efl_ref(model);
367 _eio_build_st_error(data, handler, error);
368 parent = efl_parent_get(model);
369 efl_model_child_del(parent, model);
370 efl_unref(model);
371}
372
373static void
348_eio_build_st(const Eio_Model *model, Eio_Model_Data *pd) 374_eio_build_st(const Eio_Model *model, Eio_Model_Data *pd)
349{ 375{
350 if (pd->st) return ; 376 if (pd->st) return ;
@@ -354,6 +380,19 @@ _eio_build_st(const Eio_Model *model, Eio_Model_Data *pd)
354 pd->request.stat = eio_file_direct_stat(pd->path, _eio_build_st_done, _eio_build_st_error, efl_ref(model)); 380 pd->request.stat = eio_file_direct_stat(pd->path, _eio_build_st_done, _eio_build_st_error, efl_ref(model));
355} 381}
356 382
383static void
384_eio_build_st_then_clobber(const Eio_Model *model, Eio_Model_Data *pd)
385{
386 if (pd->st) return ;
387 if (pd->request.stat) return ;
388 if (pd->error) return ;
389
390 pd->request.stat = eio_file_direct_stat(pd->path,
391 _eio_build_st_done_clobber,
392 _eio_build_st_error_clobber,
393 efl_ref(model));
394}
395
357static Eina_List *delayed_queue = NULL; 396static Eina_List *delayed_queue = NULL;
358 397
359static void 398static void
@@ -853,8 +892,7 @@ _eio_model_efl_model_child_del(Eo *obj EINA_UNUSED,
853 892
854 if (type == EINA_FILE_UNKNOWN) 893 if (type == EINA_FILE_UNKNOWN)
855 { 894 {
856 child_pd->delete_me = EINA_TRUE; 895 _eio_build_st_then_clobber(child, child_pd);
857 _eio_build_st(child, child_pd);
858 return ; 896 return ;
859 } 897 }
860 898
diff --git a/src/lib/eio/eio_model_private.h b/src/lib/eio/eio_model_private.h
index c0ac50a..bf1344a 100644
--- a/src/lib/eio/eio_model_private.h
+++ b/src/lib/eio/eio_model_private.h
@@ -68,7 +68,6 @@ struct _Eio_Model_Data
68 Eina_Error error; 68 Eina_Error error;
69 69
70 Eina_Bool listed : 1; 70 Eina_Bool listed : 1;
71 Eina_Bool delete_me : 1;
72}; 71};
73 72
74#endif 73#endif