2015-04-05 06:19:45 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2015-04-05 06:19:47 -07:00
|
|
|
#include <stdint.h>
|
2017-12-31 08:08:31 -08:00
|
|
|
#include <libgen.h>
|
2015-04-05 06:19:47 -07:00
|
|
|
|
2015-04-05 06:19:59 -07:00
|
|
|
#include <Efl.h>
|
2015-04-05 06:19:45 -07:00
|
|
|
#include <Eina.h>
|
|
|
|
#include <Ecore.h>
|
2016-06-05 16:52:52 -07:00
|
|
|
#include <Ecore_File.h>
|
2015-04-05 06:19:45 -07:00
|
|
|
#include <Eo.h>
|
2016-06-05 17:21:43 -07:00
|
|
|
#include <Efreet_Mime.h>
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2016-06-06 11:00:54 -07:00
|
|
|
#include "Eio.h"
|
|
|
|
|
2015-04-05 06:19:52 -07:00
|
|
|
#include "eio_private.h"
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
#include "efl_io_model_private.h"
|
2015-04-05 06:19:45 -07:00
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
#define MY_CLASS EFL_IO_MODEL_CLASS
|
|
|
|
#define MY_CLASS_NAME "Efl_Io_Model"
|
2015-04-05 06:19:45 -07:00
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
static void _efl_io_model_info_free(Efl_Io_Model_Info *info, Eina_Bool model);
|
2021-04-10 02:23:05 -07:00
|
|
|
static void _efl_io_model_efl_model_monitor_add(const Eo *obj, Efl_Io_Model_Data *priv);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
EINA_VALUE_STRUCT_DESC_DEFINE(_eina_file_direct_info_desc,
|
|
|
|
NULL,
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
sizeof (Efl_Io_Model_Info),
|
|
|
|
EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Efl_Io_Model_Info, path_length),
|
|
|
|
EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Efl_Io_Model_Info, name_length),
|
|
|
|
EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_ULONG, Efl_Io_Model_Info, name_start),
|
|
|
|
EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_UINT, Efl_Io_Model_Info, type),
|
|
|
|
EINA_VALUE_STRUCT_MEMBER(EINA_VALUE_TYPE_STRINGSHARE, Efl_Io_Model_Info, path));
|
2015-04-05 06:19:45 -07:00
|
|
|
/**
|
|
|
|
* Callbacks
|
|
|
|
* Property
|
|
|
|
*/
|
|
|
|
static void
|
2017-10-25 18:04:31 -07:00
|
|
|
_eio_move_done_cb(void *data, Eio_File *handler)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd");
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_Promise *p = data;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// FIXME: generate events
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
eina_promise_resolve(p, eina_value_string_init(pd->path));
|
|
|
|
pd->request.move = NULL;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-10-25 18:04:31 -07:00
|
|
|
_eio_file_error_cb(void *data, Eio_File *handler, int error)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Data *pd = ecore_thread_local_data_find(handler->thread, ".pd");
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_Promise *p = data;
|
2016-06-05 23:10:24 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
eina_promise_reject(p, error);
|
|
|
|
pd->request.move = NULL;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2019-04-02 05:50:34 -07:00
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_already_added(Efl_Io_Model_Data *pd, const char *path)
|
|
|
|
{
|
|
|
|
Efl_Io_Model_Info *mi;
|
|
|
|
Eina_List *node;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(pd->files, node, mi)
|
|
|
|
{
|
2019-07-10 11:39:44 -07:00
|
|
|
if (eina_streq(mi->path, path))
|
2019-04-02 05:50:34 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2015-04-05 06:19:45 -07:00
|
|
|
/**
|
|
|
|
* Callbacks
|
|
|
|
* Ecore Events
|
|
|
|
*/
|
|
|
|
static Eina_Bool
|
2016-06-14 15:33:41 -07:00
|
|
|
_efl_model_evt_added_ecore_cb(void *data, int type, void *event)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
Eio_Monitor_Event *ev = event;
|
2021-04-10 02:23:05 -07:00
|
|
|
Efl_Io_Model *obj = data;
|
|
|
|
Efl_Io_Model_Data *pd;
|
2021-04-10 02:24:42 -07:00
|
|
|
Efl_Model_Children_Event cevt = {0};
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Info *mi;
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Eina_Stringshare *spath = NULL;
|
|
|
|
char *path = NULL;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2021-04-10 02:23:05 -07:00
|
|
|
pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pd, EINA_TRUE);
|
|
|
|
|
2016-06-14 15:33:41 -07:00
|
|
|
if (type != EIO_MONITOR_DIRECTORY_CREATED && type != EIO_MONITOR_FILE_CREATED)
|
|
|
|
return EINA_TRUE;
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
if (ev->monitor != pd->monitor) return EINA_TRUE;
|
|
|
|
|
2019-04-02 05:50:34 -07:00
|
|
|
if (_already_added(pd, ev->filename))
|
|
|
|
return EINA_TRUE;
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
path = ecore_file_dir_get(ev->filename);
|
2019-07-10 11:39:44 -07:00
|
|
|
if (!eina_streq(pd->path, path))
|
2017-10-25 18:04:31 -07:00
|
|
|
goto end;
|
|
|
|
|
|
|
|
spath = eina_stringshare_add(ev->filename);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(pd->files, l, mi)
|
2016-06-14 15:33:41 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
if (mi->path == spath)
|
|
|
|
goto end;
|
2016-06-14 15:33:41 -07:00
|
|
|
}
|
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
mi = calloc(1, sizeof (Efl_Io_Model_Info));
|
2017-10-25 18:04:31 -07:00
|
|
|
if (!mi) goto end;
|
|
|
|
|
|
|
|
mi->path_length = eina_stringshare_strlen(spath);
|
|
|
|
mi->path = eina_stringshare_ref(spath);
|
|
|
|
mi->name_start = eina_stringshare_strlen(pd->path) + 1;
|
|
|
|
mi->name_length = mi->path_length - mi->name_start;
|
|
|
|
mi->type = EINA_FILE_UNKNOWN;
|
2019-02-23 05:57:19 -08:00
|
|
|
mi->parent_ref = EINA_FALSE;
|
|
|
|
mi->child_ref = EINA_TRUE;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
// Honor filter on new added file too
|
|
|
|
if (pd->filter.cb)
|
2016-06-14 15:33:41 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_File_Direct_Info info = { 0 };
|
2016-06-14 15:33:41 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
info.path_length = mi->path_length;
|
|
|
|
info.name_start = mi->name_start;
|
|
|
|
info.name_length = mi->name_length;
|
|
|
|
info.type = EINA_FILE_UNKNOWN;
|
2019-02-17 20:48:39 -08:00
|
|
|
strncpy(info.path, mi->path, (EINA_PATH_MAX - 1));
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
if (!pd->filter.cb(pd->filter.data, obj, &info))
|
2016-06-14 15:33:41 -07:00
|
|
|
{
|
2019-02-23 05:57:19 -08:00
|
|
|
eina_stringshare_replace(&mi->path, NULL);
|
2017-10-25 18:04:31 -07:00
|
|
|
free(mi);
|
|
|
|
goto end;
|
2016-06-14 15:33:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
cevt.index = eina_list_count(pd->files);
|
|
|
|
pd->files = eina_list_append(pd->files, mi);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// Notify of the new child being added
|
|
|
|
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
|
2018-04-12 14:41:54 -07:00
|
|
|
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
end:
|
|
|
|
eina_stringshare_del(spath);
|
|
|
|
free(path);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2019-08-23 10:21:58 -07:00
|
|
|
static void
|
2021-04-10 02:23:05 -07:00
|
|
|
_model_child_remove(Efl_Io_Model *obj, Efl_Io_Model_Data *pd, Eina_Stringshare *path)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Info *mi;
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Efl_Model_Children_Event cevt = { 0 };
|
|
|
|
unsigned int i = 0;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// FIXME: Linear search is pretty slow
|
|
|
|
EINA_LIST_FOREACH(pd->files, l, mi)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2019-08-23 10:21:58 -07:00
|
|
|
if (mi->path == path)
|
2017-10-25 18:04:31 -07:00
|
|
|
break ;
|
|
|
|
++i;
|
|
|
|
}
|
2015-04-05 06:19:53 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
if (i >= eina_list_count(pd->files))
|
2019-08-23 10:21:58 -07:00
|
|
|
return;
|
2015-04-05 06:19:53 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
cevt.index = i;
|
|
|
|
cevt.child = mi->object;
|
2015-04-05 06:19:53 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_REMOVED, &cevt);
|
2018-04-12 14:41:54 -07:00
|
|
|
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
|
2015-04-05 06:19:53 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// Remove the entry from the files list
|
|
|
|
pd->files = eina_list_remove_list(pd->files, l);
|
2016-06-14 15:33:41 -07:00
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
// This will only trigger the data destruction if no object is referencing them.
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_free(mi, EINA_FALSE);
|
2019-08-23 10:21:58 -07:00
|
|
|
}
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2019-08-23 10:21:58 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_efl_model_evt_deleted_ecore_cb(void *data, int type, void *event)
|
|
|
|
{
|
|
|
|
Eio_Monitor_Event *ev = event;
|
2021-04-10 02:23:05 -07:00
|
|
|
Efl_Io_Model *obj = data;
|
|
|
|
Efl_Io_Model_Data *pd;
|
2019-08-23 10:21:58 -07:00
|
|
|
Eina_Stringshare *spath = NULL;
|
|
|
|
|
2021-04-10 02:23:05 -07:00
|
|
|
pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS);
|
|
|
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd, EINA_TRUE);
|
|
|
|
|
2019-08-23 10:21:58 -07:00
|
|
|
if (type != EIO_MONITOR_DIRECTORY_DELETED && type != EIO_MONITOR_FILE_DELETED)
|
|
|
|
return EINA_TRUE;
|
|
|
|
|
|
|
|
if (ev->monitor != pd->monitor) return EINA_TRUE;
|
|
|
|
|
|
|
|
spath = eina_stringshare_add(ev->filename);
|
2021-04-10 02:23:05 -07:00
|
|
|
_model_child_remove(obj, pd, spath);
|
2017-10-25 18:04:31 -07:00
|
|
|
eina_stringshare_del(spath);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
return EINA_TRUE;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callbacks
|
|
|
|
* Child Del
|
|
|
|
*/
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_eio_del_cleanup(Efl_Io_Model *obj)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Data *pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
pd->request.del = NULL;
|
|
|
|
efl_unref(obj);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-10-25 18:04:31 -07:00
|
|
|
_eio_done_unlink_cb(void *data, Eio_File *handler EINA_UNUSED)
|
|
|
|
{
|
2021-04-10 02:23:05 -07:00
|
|
|
Efl_Io_Model *child = data, *parent;
|
2019-08-23 10:21:58 -07:00
|
|
|
Efl_Io_Model_Data *child_pd, *pd;
|
|
|
|
|
2021-04-10 02:23:05 -07:00
|
|
|
parent = efl_parent_get(child);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(parent);
|
2019-08-23 10:21:58 -07:00
|
|
|
child_pd = efl_data_scope_get(child, MY_CLASS);
|
2021-04-10 02:23:05 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(child_pd);
|
|
|
|
pd = efl_data_scope_get(parent, MY_CLASS);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(parent);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
2021-04-10 02:23:05 -07:00
|
|
|
_model_child_remove(parent, pd, child_pd->path);
|
2017-10-25 18:04:31 -07:00
|
|
|
_eio_del_cleanup(child);
|
|
|
|
}
|
2015-04-05 06:19:45 -07:00
|
|
|
|
|
|
|
static void
|
2017-10-25 18:04:31 -07:00
|
|
|
_eio_error_unlink_cb(void *data, Eio_File *handler EINA_UNUSED, int error)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model *child = data;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
ERR("%d: %s.", error, strerror(error));
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
_eio_del_cleanup(child);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_free(Efl_Io_Model_Info *info, Eina_Bool model)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
if (!info) return ;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
if (!model)
|
|
|
|
{
|
|
|
|
info->child_ref = EINA_FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
info->parent_ref = EINA_FALSE;
|
|
|
|
}
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
if (info->child_ref ||
|
|
|
|
info->parent_ref)
|
|
|
|
return ;
|
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
eina_stringshare_replace(&info->path, NULL);
|
2017-10-25 18:04:31 -07:00
|
|
|
free(info);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static Eina_File_Type
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_type_get(const Eina_File_Direct_Info *info, const Eina_Stat *st)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (info && info->type != EINA_FILE_UNKNOWN)
|
|
|
|
return info->type;
|
|
|
|
if (st)
|
|
|
|
{
|
|
|
|
if (S_ISREG(st->mode))
|
|
|
|
return EINA_FILE_REG;
|
|
|
|
else if (S_ISDIR(st->mode))
|
|
|
|
return EINA_FILE_DIR;
|
|
|
|
else if (S_ISCHR(st->mode))
|
|
|
|
return EINA_FILE_CHR;
|
|
|
|
else if (S_ISBLK(st->mode))
|
|
|
|
return EINA_FILE_BLK;
|
|
|
|
else if (S_ISFIFO(st->mode))
|
|
|
|
return EINA_FILE_FIFO;
|
2019-05-22 04:59:05 -07:00
|
|
|
#ifndef _WIN32
|
2017-10-25 18:04:31 -07:00
|
|
|
else if (S_ISLNK(st->mode))
|
|
|
|
return EINA_FILE_LNK;
|
2019-05-22 04:59:05 -07:00
|
|
|
#endif
|
2018-05-02 09:26:24 -07:00
|
|
|
#ifdef S_ISSOCK
|
2017-10-25 18:04:31 -07:00
|
|
|
else if (S_ISSOCK(st->mode))
|
|
|
|
return EINA_FILE_SOCK;
|
2018-05-02 09:26:24 -07:00
|
|
|
#endif
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
return EINA_FILE_UNKNOWN;
|
|
|
|
}
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_build(const Efl_Io_Model *model, Efl_Io_Model_Data *pd)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
char *path;
|
|
|
|
|
|
|
|
if (pd->info) goto end;
|
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
pd->info = calloc(1, sizeof (Efl_Io_Model_Info));
|
2017-10-25 18:04:31 -07:00
|
|
|
if (!pd->info) return ;
|
|
|
|
|
|
|
|
pd->info->path_length = eina_stringshare_strlen(pd->path);
|
|
|
|
pd->info->path = eina_stringshare_ref(pd->path);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
path = strdup(pd->path);
|
|
|
|
pd->info->name_start = basename(path) - path;
|
|
|
|
pd->info->name_length = pd->info->path_length - pd->info->name_start;
|
|
|
|
free(path);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
pd->info->type = _efl_io_model_info_type_get(NULL, pd->st);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
efl_model_properties_changed(model, "direct_info");
|
|
|
|
|
|
|
|
end:
|
|
|
|
pd->info->parent_ref = EINA_TRUE;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
|
|
|
_eio_build_st_done(void *data, Eio_File *handler EINA_UNUSED, const Eina_Stat *stat)
|
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model *model = data;
|
|
|
|
Efl_Io_Model_Data *pd = efl_data_scope_get(model, EFL_IO_MODEL_CLASS);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
if (!pd) return ;
|
|
|
|
pd->request.stat = NULL;
|
2016-10-25 16:54:29 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
pd->st = malloc(sizeof (Eina_Stat));
|
|
|
|
if (!pd->st) return ;
|
2016-10-25 16:54:29 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
memcpy(pd->st, stat, sizeof (Eina_Stat));
|
2016-10-25 16:54:29 -07:00
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
if (!pd->info) _efl_io_model_info_build(model, pd);
|
2017-10-25 18:04:31 -07:00
|
|
|
if (pd->info->type == EINA_FILE_UNKNOWN)
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
pd->info->type = _efl_io_model_info_type_get(NULL, stat);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
efl_model_properties_changed(model, "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat");
|
|
|
|
|
|
|
|
if (eio_file_is_dir(pd->st))
|
2016-10-25 16:54:29 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
// Now that we know we are a directory, we should whatch it
|
2021-04-10 02:23:05 -07:00
|
|
|
_efl_io_model_efl_model_monitor_add(model, pd);
|
2016-10-25 16:54:29 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// And start listing its child
|
|
|
|
efl_model_children_count_get(model);
|
2016-10-25 16:54:29 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
|
2018-05-02 09:11:21 -07:00
|
|
|
efl_unref(model);
|
2016-10-25 16:54:29 -07:00
|
|
|
}
|
|
|
|
|
2018-07-10 06:43:55 -07:00
|
|
|
static void
|
|
|
|
_eio_build_st_done_clobber(void *data, Eio_File *handler, const Eina_Stat *stat)
|
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model *model = data;
|
|
|
|
Efl_Io_Model *parent;
|
2018-07-10 06:43:55 -07:00
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
efl_ref(model); // For st_done
|
2018-07-10 06:43:55 -07:00
|
|
|
_eio_build_st_done(data, handler, stat);
|
|
|
|
parent = efl_parent_get(model);
|
|
|
|
efl_model_child_del(parent, model);
|
2019-02-23 05:57:19 -08:00
|
|
|
efl_unref(model); // From the async thread early ref
|
2018-07-10 06:43:55 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
|
|
|
_eio_build_st_error(void *data, Eio_File *handler EINA_UNUSED, int error)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model *model = data;
|
|
|
|
Efl_Io_Model_Data *pd = efl_data_scope_get(model, EFL_IO_MODEL_CLASS);
|
2016-09-29 09:12:09 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
pd->request.stat = NULL;
|
|
|
|
pd->error = error;
|
2016-10-25 16:54:29 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
efl_model_properties_changed(model, "direct_info", "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat");
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2018-05-02 09:11:21 -07:00
|
|
|
efl_unref(model);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
2015-04-05 06:19:55 -07:00
|
|
|
|
2018-07-10 06:43:55 -07:00
|
|
|
static void
|
|
|
|
_eio_build_st_error_clobber(void *data, Eio_File *handler, int error)
|
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model *model = data;
|
2018-07-10 06:43:55 -07:00
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
efl_ref(model); // For st_error unref
|
2018-07-10 06:43:55 -07:00
|
|
|
_eio_build_st_error(data, handler, error);
|
2019-02-23 05:57:19 -08:00
|
|
|
efl_unref(model); // From the async thread early ref
|
2018-07-10 06:43:55 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_eio_build_st(const Efl_Io_Model *model, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->st) return ;
|
|
|
|
if (pd->request.stat) return ;
|
|
|
|
if (pd->error) return ;
|
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
pd->request.stat = eio_file_direct_stat(pd->path,
|
|
|
|
_eio_build_st_done,
|
|
|
|
_eio_build_st_error,
|
|
|
|
efl_ref(model));
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
2018-07-10 06:43:55 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_eio_build_st_then_clobber(const Efl_Io_Model *model, Efl_Io_Model_Data *pd)
|
2018-07-10 06:43:55 -07:00
|
|
|
{
|
|
|
|
if (pd->st) return ;
|
|
|
|
if (pd->request.stat) return ;
|
|
|
|
if (pd->error) return ;
|
|
|
|
|
|
|
|
pd->request.stat = eio_file_direct_stat(pd->path,
|
|
|
|
_eio_build_st_done_clobber,
|
|
|
|
_eio_build_st_error_clobber,
|
|
|
|
efl_ref(model));
|
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static Eina_List *delayed_queue = NULL;
|
2019-03-21 13:33:30 -07:00
|
|
|
static Eina_Bool delayed_one = EINA_FALSE;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_delayed_flush(void *data EINA_UNUSED, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
Eina_Promise *p;
|
2019-03-21 13:33:30 -07:00
|
|
|
Eina_List *tmp = delayed_queue;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
efl_event_callback_del(ev->object, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL);
|
2019-03-21 13:33:30 -07:00
|
|
|
|
|
|
|
delayed_one = EINA_FALSE;
|
|
|
|
delayed_queue = NULL;
|
|
|
|
EINA_LIST_FREE(tmp, p)
|
|
|
|
eina_promise_resolve(p, EINA_VALUE_EMPTY);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
2019-01-04 16:01:40 -08:00
|
|
|
static Eina_Value
|
2019-01-04 17:42:26 -08:00
|
|
|
_cancel_request(Eo *model EINA_UNUSED, void *data, Eina_Error error)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
delayed_queue = eina_list_remove_list(delayed_queue, data);
|
2019-01-04 16:01:40 -08:00
|
|
|
|
|
|
|
return eina_value_error_init(error);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Future *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_build_delay(Efl_Io_Model *model)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
Eina_Promise *p;
|
|
|
|
|
2019-01-04 17:42:26 -08:00
|
|
|
p = efl_loop_promise_new(model);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
if (!delayed_queue)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
// Remove callback, just in case it is still there.
|
2019-01-04 17:42:26 -08:00
|
|
|
efl_event_callback_del(efl_loop_get(model), EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL);
|
|
|
|
efl_event_callback_add(efl_loop_get(model), EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL);
|
2017-10-25 18:04:31 -07:00
|
|
|
// FIXME: It would be nice to be able to build a future directly to be triggered on one event
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
delayed_queue = eina_list_append(delayed_queue, p);
|
|
|
|
|
2019-01-04 17:42:26 -08:00
|
|
|
return efl_future_then(model, eina_future_new(p),
|
2019-01-04 16:01:40 -08:00
|
|
|
.error = _cancel_request,
|
|
|
|
.data = eina_list_last(delayed_queue));
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value
|
2019-03-13 14:50:48 -07:00
|
|
|
_eio_build_mime_now(Eo *model, void *data, const Eina_Value v)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
2019-03-13 14:50:48 -07:00
|
|
|
Efl_Io_Model_Data *pd = data;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
// Make sure that we are not over consuming time in the main loop
|
2019-03-21 13:33:30 -07:00
|
|
|
if (!delayed_one &&
|
|
|
|
(delayed_queue || ecore_time_get() - ecore_loop_time_get() > 0.004))
|
2016-06-05 17:21:43 -07:00
|
|
|
{
|
2019-03-13 14:50:48 -07:00
|
|
|
Eina_Future *f = efl_future_then(model, _build_delay(model),
|
|
|
|
.success = _eio_build_mime_now,
|
|
|
|
.data = pd);
|
2018-11-21 17:33:10 -08:00
|
|
|
return eina_future_as_value(efl_future_then(model, f));
|
2016-06-05 17:21:43 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
pd->mime_type = efreet_mime_type_get(pd->path);
|
|
|
|
|
|
|
|
efl_model_properties_changed(model, "mime_type");
|
2019-03-21 13:33:30 -07:00
|
|
|
delayed_one = EINA_TRUE;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_eio_build_mime(const Efl_Object *model, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->mime_type) return ;
|
|
|
|
if (pd->request.mime) return ;
|
|
|
|
|
2019-03-15 16:55:07 -07:00
|
|
|
pd->request.mime = efl_future_then(model, efl_loop_job(efl_loop_get(model)),
|
2019-03-13 14:50:48 -07:00
|
|
|
.success = _eio_build_mime_now,
|
|
|
|
.data = pd);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_filename_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_build(obj, pd);
|
2017-10-25 18:04:31 -07:00
|
|
|
if (pd->info)
|
|
|
|
return eina_value_string_new(pd->info->path + pd->info->name_start);
|
|
|
|
return eina_value_error_new(EAGAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_direct_info_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_build(obj, pd);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
if (pd->info)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_Value *r;
|
|
|
|
|
|
|
|
r = eina_value_struct_new(_eina_file_direct_info_desc());
|
|
|
|
if (!r) return NULL;
|
|
|
|
if (!eina_value_pset(r, pd->info))
|
|
|
|
{
|
|
|
|
eina_value_free(r);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return r;
|
2015-04-05 06:19:55 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
if (pd->error)
|
|
|
|
return eina_value_error_new(pd->error);
|
|
|
|
return eina_value_error_new(EAGAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TIMECB(Prop) \
|
|
|
|
static Eina_Value * \
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_##Prop##_cb(const Eo *obj, Efl_Io_Model_Data *pd) \
|
2017-10-25 18:04:31 -07:00
|
|
|
{ \
|
|
|
|
if (pd->st) \
|
|
|
|
return eina_value_time_new(pd->st->Prop); \
|
|
|
|
if (pd->error) \
|
|
|
|
return eina_value_error_new(pd->error); \
|
|
|
|
\
|
|
|
|
_eio_build_st(obj, pd); \
|
|
|
|
return eina_value_error_new(EAGAIN); \
|
|
|
|
}
|
|
|
|
|
|
|
|
TIMECB(mtime);
|
|
|
|
TIMECB(atime);
|
|
|
|
TIMECB(ctime);
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_is_dir_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->st)
|
|
|
|
return eina_value_bool_new(eio_file_is_dir(pd->st));
|
|
|
|
if (pd->error)
|
|
|
|
return eina_value_error_new(pd->error);
|
|
|
|
|
|
|
|
_eio_build_st(obj, pd);
|
|
|
|
return eina_value_error_new(EAGAIN);
|
|
|
|
}
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_is_lnk_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->st)
|
|
|
|
return eina_value_bool_new(eio_file_is_lnk(pd->st));
|
|
|
|
if (pd->error)
|
|
|
|
return eina_value_error_new(pd->error);
|
|
|
|
|
|
|
|
_eio_build_st(obj, pd);
|
|
|
|
return eina_value_error_new(EAGAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_size_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->st)
|
|
|
|
return eina_value_ulong_new(pd->st->size);
|
|
|
|
if (pd->error)
|
|
|
|
return eina_value_error_new(pd->error);
|
|
|
|
|
|
|
|
_eio_build_st(obj, pd);
|
2018-11-21 16:43:10 -08:00
|
|
|
return eina_value_error_new(EAGAIN);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_stat_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->st)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_Value *r;
|
|
|
|
|
|
|
|
r = eina_value_struct_new(_eina_stat_desc());
|
|
|
|
if (!r) return NULL;
|
|
|
|
if (!eina_value_pset(r, pd->info))
|
|
|
|
{
|
|
|
|
eina_value_free(r);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return r;
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
if (pd->error)
|
|
|
|
return eina_value_error_new(pd->error);
|
|
|
|
|
|
|
|
_eio_build_st(obj, pd);
|
|
|
|
return eina_value_error_new(EAGAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_property_mime_type_cb(const Eo *obj, Efl_Io_Model_Data *pd)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
if (pd->mime_type)
|
|
|
|
return eina_value_string_new(pd->mime_type);
|
2019-03-13 14:51:20 -07:00
|
|
|
if (pd->error) return eina_value_error_new(pd->error);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
_eio_build_mime(obj, pd);
|
|
|
|
return eina_value_error_new(EAGAIN);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
#define PP(Name) \
|
|
|
|
{ #Name, _property_##Name##_cb }
|
|
|
|
|
|
|
|
static struct {
|
|
|
|
const char *name;
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Eina_Value *(*cb)(const Eo *obj, Efl_Io_Model_Data *pd);
|
2017-10-25 18:04:31 -07:00
|
|
|
} properties[] = {
|
2019-04-18 16:16:26 -07:00
|
|
|
PP(filename),
|
2017-10-25 18:04:31 -07:00
|
|
|
PP(direct_info),
|
|
|
|
PP(mtime), PP(atime), PP(ctime), PP(is_dir), PP(is_lnk), PP(size),
|
|
|
|
PP(stat),
|
|
|
|
PP(mime_type)
|
|
|
|
};
|
|
|
|
|
2019-06-05 13:23:45 -07:00
|
|
|
typedef struct _Efl_Io_Model_Iterator Efl_Io_Model_Iterator;
|
|
|
|
struct _Efl_Io_Model_Iterator
|
|
|
|
{
|
|
|
|
Eina_Iterator iterator;
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int end;
|
|
|
|
};
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_efl_io_model_iterator_next(Efl_Io_Model_Iterator *it, void **data)
|
|
|
|
{
|
|
|
|
const char **name = (const char **)data;
|
|
|
|
|
|
|
|
if (it->i >= it->end)
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
*name = properties[it->i].name;
|
|
|
|
it->i++;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void*
|
|
|
|
_efl_io_model_iterator_get_container(Efl_Io_Model_Iterator *it EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return &properties;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_efl_io_model_iterator_free(Efl_Io_Model_Iterator *it)
|
|
|
|
{
|
|
|
|
free(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
Eina_Iterator *
|
|
|
|
_efl_io_model_properties_iterator_new(void)
|
|
|
|
{
|
|
|
|
Efl_Io_Model_Iterator *it;
|
|
|
|
|
|
|
|
it = calloc(1, sizeof (Efl_Io_Model_Iterator));
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
|
|
|
|
|
|
|
it->i = 0;
|
|
|
|
it->end = EINA_C_ARRAY_LENGTH(properties);
|
|
|
|
|
|
|
|
it->iterator.version = EINA_ITERATOR_VERSION;
|
|
|
|
it->iterator.next = FUNC_ITERATOR_NEXT(_efl_io_model_iterator_next);
|
|
|
|
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(
|
|
|
|
_efl_io_model_iterator_get_container);
|
|
|
|
it->iterator.free = FUNC_ITERATOR_FREE(_efl_io_model_iterator_free);
|
|
|
|
|
|
|
|
return &it->iterator;
|
|
|
|
}
|
|
|
|
|
2015-04-05 06:19:45 -07:00
|
|
|
/**
|
2017-10-25 18:04:31 -07:00
|
|
|
* Interfaces impl.
|
2015-04-05 06:19:45 -07:00
|
|
|
*/
|
2018-11-23 08:25:19 -08:00
|
|
|
static Eina_Iterator *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_properties_get(const Eo *obj EINA_UNUSED,
|
|
|
|
Efl_Io_Model_Data *pd EINA_UNUSED)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
2019-06-05 13:23:45 -07:00
|
|
|
return _efl_io_model_properties_iterator_new();
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Value *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_property_get(const Eo *obj, Efl_Io_Model_Data *pd, const char *property)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
if (!property) return NULL;
|
|
|
|
|
|
|
|
for (i = 0; i < EINA_C_ARRAY_LENGTH(properties); ++i)
|
|
|
|
if (property == properties[i].name ||
|
2019-07-10 11:39:44 -07:00
|
|
|
eina_streq(property, properties[i].name))
|
2017-10-25 18:04:31 -07:00
|
|
|
return properties[i].cb(obj, pd);
|
|
|
|
|
2019-04-18 16:16:26 -07:00
|
|
|
return efl_model_property_get(efl_super(obj, EFL_IO_MODEL_CLASS), property);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Future *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_property_set(Eo *obj,
|
|
|
|
Efl_Io_Model_Data *pd,
|
|
|
|
const char *property, Eina_Value *value)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
const char *path;
|
|
|
|
Eina_Future *f;
|
|
|
|
Eina_Value s = EINA_VALUE_EMPTY;
|
|
|
|
Eina_Error err = EFL_MODEL_ERROR_NOT_FOUND;
|
|
|
|
Eina_Bool finalized = !!pd->path;
|
|
|
|
|
|
|
|
if (!property) goto on_error;
|
2016-09-29 09:12:09 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
err = EFL_MODEL_ERROR_NOT_SUPPORTED;
|
2019-07-10 11:39:44 -07:00
|
|
|
if (!eina_streq(property, "path")) goto on_error;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
if (finalized && pd->request.move) goto on_error;
|
|
|
|
|
|
|
|
err = EFL_MODEL_ERROR_UNKNOWN;
|
|
|
|
if (!eina_value_setup(&s, EINA_VALUE_TYPE_STRING)) goto on_error;
|
|
|
|
if (!eina_value_convert(value, &s)) goto on_error;
|
|
|
|
if (!eina_value_string_get(&s, &path)) goto on_error;
|
|
|
|
|
|
|
|
eina_stringshare_replace(&pd->path, path);
|
|
|
|
|
|
|
|
if (finalized)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
2019-01-04 17:42:26 -08:00
|
|
|
Eina_Promise *p = efl_loop_promise_new(obj);
|
2017-10-25 18:04:31 -07:00
|
|
|
f = eina_future_new(p);
|
|
|
|
|
|
|
|
pd->request.move = eio_file_move(pd->path, path,
|
|
|
|
NULL, /* FIXME: have a move progress property */
|
|
|
|
_eio_move_done_cb, _eio_file_error_cb, p);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
ecore_thread_local_data_add(pd->request.move->thread, ".pd", pd, NULL, EINA_TRUE);
|
2019-01-04 16:01:40 -08:00
|
|
|
|
|
|
|
f = _efl_io_manager_future(obj, f, pd->request.move);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
// FIXME: turn on monitor in the finalize stage or after move
|
|
|
|
}
|
|
|
|
else
|
2016-12-16 14:10:11 -08:00
|
|
|
{
|
2019-02-23 05:57:19 -08:00
|
|
|
f = efl_loop_future_resolved(obj, eina_value_stringshare_init(pd->path));
|
2016-12-16 14:10:11 -08:00
|
|
|
}
|
|
|
|
|
2019-01-04 16:01:40 -08:00
|
|
|
return f;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
on_error:
|
2018-11-22 17:14:16 -08:00
|
|
|
return efl_loop_future_rejected(obj, err);
|
2017-10-25 18:04:31 -07:00
|
|
|
}
|
|
|
|
|
efl_io_model: next try to fix this race condition
what is happening is that a file gets announced through eio_model
listing code, at this point of time, the monitor does not yet know about
the file. If the file now gets deleted between the annoncing and the
learning of the file from the monitor, then the file got an ADD event,
but no DEL event. Which is a bug.
With this commit there is a new API which asks the monitor if the file
already has the knowledge about the files existance, or not. A few
monitors like win32 inotify or cocoa do not have context about the file
directly, if the OS is now having the same bug, then we are again in
trouble, however, we canot do anything about that. In the case of kevent
or poll, this asks the context of the monitor if the file is already
there.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10006
2019-09-18 02:32:08 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_monitor_has_context(Efl_Io_Model_Data *pd, const char *path)
|
|
|
|
{
|
|
|
|
return eio_monitor_has_context(pd->monitor, path);
|
|
|
|
}
|
|
|
|
|
2019-09-18 05:21:00 -07:00
|
|
|
static void
|
|
|
|
_efl_io_model_children_list(void *data, Eina_Array *entries)
|
|
|
|
{
|
|
|
|
Eina_File_Direct_Info *info;
|
|
|
|
Efl_Model *obj = data;
|
|
|
|
Efl_Io_Model_Data *pd;
|
|
|
|
Efl_Model_Children_Event cevt = { 0 };
|
|
|
|
Eina_Array_Iterator iterator;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
pd = efl_data_scope_get(obj, EFL_IO_MODEL_CLASS);
|
|
|
|
if (!pd) return ;
|
|
|
|
|
|
|
|
EINA_ARRAY_ITER_NEXT(entries, i, info, iterator)
|
|
|
|
{
|
|
|
|
Efl_Io_Model_Info *mi;
|
|
|
|
|
efl_io_model: next try to fix this race condition
what is happening is that a file gets announced through eio_model
listing code, at this point of time, the monitor does not yet know about
the file. If the file now gets deleted between the annoncing and the
learning of the file from the monitor, then the file got an ADD event,
but no DEL event. Which is a bug.
With this commit there is a new API which asks the monitor if the file
already has the knowledge about the files existance, or not. A few
monitors like win32 inotify or cocoa do not have context about the file
directly, if the OS is now having the same bug, then we are again in
trouble, however, we canot do anything about that. In the case of kevent
or poll, this asks the context of the monitor if the file is already
there.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10006
2019-09-18 02:32:08 -07:00
|
|
|
if (!_monitor_has_context(pd, info->path)) continue;
|
2019-09-18 05:21:00 -07:00
|
|
|
if (_already_added(pd, info->path)) continue;
|
|
|
|
|
|
|
|
if (pd->filter.cb)
|
|
|
|
{
|
|
|
|
if (!pd->filter.cb(pd->filter.data, obj, info))
|
|
|
|
continue ;
|
|
|
|
}
|
|
|
|
|
|
|
|
mi = calloc(1, sizeof (Efl_Io_Model_Info));
|
|
|
|
if (!mi) continue ;
|
|
|
|
|
|
|
|
mi->path_length = info->path_length;
|
|
|
|
mi->path = eina_stringshare_add(info->path);
|
|
|
|
|
|
|
|
mi->name_start = info->name_start;
|
|
|
|
mi->name_length = info->name_length;
|
|
|
|
mi->type = _efl_io_model_info_type_get(info, NULL);
|
|
|
|
mi->parent_ref = EINA_FALSE;
|
|
|
|
mi->child_ref = EINA_TRUE;
|
|
|
|
|
|
|
|
cevt.index = eina_list_count(pd->files);
|
|
|
|
cevt.child = NULL;
|
|
|
|
|
|
|
|
pd->files = eina_list_append(pd->files, mi);
|
|
|
|
|
|
|
|
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILD_ADDED, &cevt);
|
|
|
|
}
|
|
|
|
|
|
|
|
efl_event_callback_call(obj, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_efl_io_model_children_list_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Efl_Io_Model_Data *pd = data;
|
|
|
|
|
|
|
|
pd->request.listing = NULL;
|
|
|
|
pd->listed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2015-04-05 06:19:45 -07:00
|
|
|
/**
|
2016-04-20 13:07:53 -07:00
|
|
|
* Children Count Get
|
2015-04-05 06:19:45 -07:00
|
|
|
*/
|
2017-10-25 18:04:31 -07:00
|
|
|
static unsigned int
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_children_count_get(const Eo *obj, Efl_Io_Model_Data *pd)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
// If we have no information on the object, let's build it.
|
2019-03-15 15:54:26 -07:00
|
|
|
if (efl_invalidated_get(obj) ||
|
|
|
|
efl_invalidating_get(obj))
|
2017-09-06 20:04:40 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
return 0;
|
2017-09-06 20:04:40 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
else if (!pd->info)
|
|
|
|
{
|
|
|
|
_eio_build_st(obj, pd);
|
|
|
|
}
|
2019-09-18 05:21:00 -07:00
|
|
|
else if (!pd->listed &&
|
|
|
|
!pd->request.listing &&
|
|
|
|
pd->info->type == EINA_FILE_DIR)
|
|
|
|
{
|
|
|
|
Efl_Io_Manager *iom;
|
|
|
|
Eina_Future *f;
|
|
|
|
|
|
|
|
iom = efl_provider_find(obj, EFL_IO_MANAGER_CLASS);
|
|
|
|
if (!iom)
|
|
|
|
{
|
|
|
|
ERR("Could not find an Efl.Io.Manager on %p.", obj);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
f = efl_io_manager_direct_ls(iom, pd->path, EINA_FALSE,
|
|
|
|
(void*) obj, _efl_io_model_children_list, NULL);
|
|
|
|
|
|
|
|
//start monitoring before listing is done
|
|
|
|
//we will filter later on if we already published a file or not
|
2021-04-10 02:23:05 -07:00
|
|
|
_efl_io_model_efl_model_monitor_add(obj, pd);
|
2019-09-18 05:21:00 -07:00
|
|
|
pd->request.listing = efl_future_then(obj, f,
|
|
|
|
.free = _efl_io_model_children_list_cleanup,
|
|
|
|
.data = pd);
|
|
|
|
}
|
2017-09-06 20:04:40 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
return eina_list_count(pd->files);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2021-04-10 02:23:05 -07:00
|
|
|
_efl_io_model_efl_model_monitor_add(const Eo *obj, Efl_Io_Model_Data *priv)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2015-04-05 06:19:53 -07:00
|
|
|
if (!priv->monitor)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2015-04-05 06:19:53 -07:00
|
|
|
int i = 0;
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
priv->monitor = eio_monitor_add(priv->path);
|
|
|
|
|
2015-04-05 06:19:53 -07:00
|
|
|
for (i = 0; priv->mon.mon_event_child_add[i] != EIO_MONITOR_ERROR ; ++i)
|
|
|
|
priv->mon.ecore_child_add_handler[i] =
|
2021-04-10 02:23:05 -07:00
|
|
|
ecore_event_handler_add(priv->mon.mon_event_child_add[i], _efl_model_evt_added_ecore_cb, obj);
|
2015-04-05 06:19:53 -07:00
|
|
|
|
|
|
|
for (i = 0; priv->mon.mon_event_child_del[i] != EIO_MONITOR_ERROR ; ++i)
|
2016-06-14 15:33:41 -07:00
|
|
|
priv->mon.ecore_child_del_handler[i] =
|
2021-04-10 02:23:05 -07:00
|
|
|
ecore_event_handler_add(priv->mon.mon_event_child_del[i], _efl_model_evt_deleted_ecore_cb, obj);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-14 15:33:41 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_monitor_del(Efl_Io_Model_Data *priv)
|
2016-06-14 15:33:41 -07:00
|
|
|
{
|
|
|
|
if (priv->monitor)
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
for (i = 0; priv->mon.mon_event_child_add[i] != EIO_MONITOR_ERROR ; ++i)
|
|
|
|
ecore_event_handler_del(priv->mon.ecore_child_add_handler[i]);
|
|
|
|
|
|
|
|
for (i = 0; priv->mon.mon_event_child_del[i] != EIO_MONITOR_ERROR ; ++i)
|
|
|
|
ecore_event_handler_del(priv->mon.ecore_child_del_handler[i]);
|
|
|
|
|
|
|
|
eio_monitor_del(priv->monitor);
|
|
|
|
priv->monitor = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-05 06:19:45 -07:00
|
|
|
/*
|
|
|
|
* Callbacks
|
|
|
|
* Children Load
|
|
|
|
*/
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_children_filter_set(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *pd,
|
|
|
|
void *filter_data, EflIoFilter filter, Eina_Free_Cb filter_free_cb)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
pd->filter.data = filter_data;
|
|
|
|
pd->filter.cb = filter;
|
|
|
|
pd->filter.free = filter_free_cb;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
/**
|
|
|
|
* Child Add
|
|
|
|
*/
|
|
|
|
static Eo *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_child_add(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv EINA_UNUSED)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
return NULL;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
/**
|
|
|
|
* Child Remove
|
|
|
|
*/
|
2015-04-05 06:19:45 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_child_del(Eo *obj EINA_UNUSED,
|
|
|
|
Efl_Io_Model_Data *priv EINA_UNUSED,
|
|
|
|
Eo *child)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Data *child_pd;
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_File_Type type;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
child_pd = efl_data_scope_get(child, MY_CLASS);
|
2019-02-23 05:57:19 -08:00
|
|
|
if (!child_pd->info) return;
|
|
|
|
if (child_pd->error) return;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
type = child_pd->info->type;
|
2016-06-14 15:33:41 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
if (type == EINA_FILE_UNKNOWN)
|
2017-09-06 20:04:40 -07:00
|
|
|
{
|
2018-07-10 06:43:55 -07:00
|
|
|
_eio_build_st_then_clobber(child, child_pd);
|
2017-10-25 18:04:31 -07:00
|
|
|
return ;
|
2017-09-06 20:04:40 -07:00
|
|
|
}
|
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
// Already in progress
|
|
|
|
if (child_pd->request.del) return;
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
efl_ref(child);
|
|
|
|
if (type == EINA_FILE_DIR)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
child_pd->request.del = eio_dir_unlink(child_pd->path,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
_eio_done_unlink_cb,
|
|
|
|
_eio_error_unlink_cb,
|
|
|
|
child);
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
else
|
2017-09-06 20:04:40 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
child_pd->request.del = eio_file_unlink(child_pd->path,
|
|
|
|
_eio_done_unlink_cb,
|
|
|
|
_eio_error_unlink_cb,
|
|
|
|
child);
|
2017-09-06 20:04:40 -07:00
|
|
|
}
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-10-25 18:04:31 -07:00
|
|
|
* Children Slice Get
|
2015-04-05 06:19:45 -07:00
|
|
|
*/
|
2017-10-25 18:04:31 -07:00
|
|
|
static Eina_Future *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_children_slice_get(Eo *obj, Efl_Io_Model_Data *pd,
|
|
|
|
unsigned int start, unsigned int count)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
Eina_Future_Scheduler *scheduler = NULL;
|
|
|
|
Eina_Value array = EINA_VALUE_EMPTY;
|
|
|
|
Eina_List *ls = NULL;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// If called on an invalidated model, we won't have a scheduler
|
|
|
|
scheduler = efl_loop_future_scheduler_get(obj);
|
|
|
|
if (!scheduler) return NULL;
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2018-06-07 14:41:48 -07:00
|
|
|
if (count == 0)
|
|
|
|
{
|
|
|
|
count = eina_list_count(pd->files);
|
|
|
|
start = 0;
|
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// Children must have been listed first
|
|
|
|
if (count == 0 || (start + count > eina_list_count(pd->files)))
|
|
|
|
return eina_future_rejected(scheduler, EFL_MODEL_ERROR_INCORRECT_VALUE);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
eina_value_array_setup(&array, EINA_VALUE_TYPE_OBJECT, count % 8);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
ls = eina_list_nth_list(pd->files, start);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
while (count > 0)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Info *info = eina_list_data_get(ls);
|
|
|
|
Efl_Io_Model_Data *child_data = NULL;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
info->parent_ref = EINA_TRUE;
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
if (info->object == NULL)
|
|
|
|
// Little trick here, setting internal data before finalize
|
2019-02-23 05:57:19 -08:00
|
|
|
info->object = efl_add_ref(EFL_IO_MODEL_CLASS, obj,
|
|
|
|
efl_loop_model_volatile_make(efl_added),
|
|
|
|
child_data = efl_data_scope_get(efl_added, EFL_IO_MODEL_CLASS),
|
|
|
|
child_data->info = info,
|
|
|
|
child_data->path = eina_stringshare_ref(info->path),
|
|
|
|
child_data->parent = ls,
|
|
|
|
// NOTE: We are assuming here that the parent model will outlive all its children
|
|
|
|
child_data->filter.cb = pd->filter.cb,
|
|
|
|
child_data->filter.data = pd->filter.data);
|
2019-04-25 15:38:20 -07:00
|
|
|
else
|
|
|
|
efl_ref(info->object);
|
2017-10-25 18:04:31 -07:00
|
|
|
eina_value_array_append(&array, info->object);
|
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
efl_wref_add(info->object, &info->object);
|
|
|
|
efl_unref(info->object);
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
count--;
|
|
|
|
ls = eina_list_next(ls);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
return eina_future_resolved(scheduler, array);
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
|
2015-04-05 06:19:45 -07:00
|
|
|
/**
|
|
|
|
* Class definitions
|
|
|
|
*/
|
2017-10-25 18:04:31 -07:00
|
|
|
static Efl_Object *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_object_finalize(Eo *obj, Efl_Io_Model_Data *pd)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
if (!pd->path) return NULL;
|
2018-05-23 20:18:18 -07:00
|
|
|
if (!efl_provider_find(obj, EFL_LOOP_CLASS))
|
|
|
|
{
|
|
|
|
ERR("Eio.Model require a parent that provide access to the main loop.");
|
|
|
|
return NULL;
|
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
|
|
|
|
// If we have no info at all, let's check this path first
|
|
|
|
if (!pd->info) _eio_build_st(obj, pd);
|
2015-04-05 06:19:55 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// Setup monitor
|
|
|
|
pd->mon.mon_event_child_add[0] = EIO_MONITOR_DIRECTORY_CREATED;
|
|
|
|
pd->mon.mon_event_child_add[1] = EIO_MONITOR_FILE_CREATED;
|
|
|
|
pd->mon.mon_event_child_add[2] = EIO_MONITOR_ERROR;
|
|
|
|
pd->mon.mon_event_child_del[0] = EIO_MONITOR_DIRECTORY_DELETED;
|
|
|
|
pd->mon.mon_event_child_del[1] = EIO_MONITOR_FILE_DELETED;
|
|
|
|
pd->mon.mon_event_child_del[2] = EIO_MONITOR_ERROR;
|
2015-04-05 06:19:55 -07:00
|
|
|
|
2015-05-19 03:41:27 -07:00
|
|
|
return obj;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_path_set(Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv, const char *path)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
char *sanitized = eina_file_path_sanitize(path);
|
|
|
|
priv->path = eina_stringshare_add(sanitized);
|
|
|
|
free(sanitized);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_path_get(const Eo *obj EINA_UNUSED, Efl_Io_Model_Data *priv)
|
2017-10-25 18:04:31 -07:00
|
|
|
{
|
|
|
|
return priv->path;
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_object_destructor(Eo *obj , Efl_Io_Model_Data *priv)
|
2015-04-05 06:19:45 -07:00
|
|
|
{
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
Efl_Io_Model_Info *info;
|
2015-04-05 06:19:49 -07:00
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
free(priv->st);
|
|
|
|
priv->st = NULL;
|
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_free(priv->info, EINA_TRUE);
|
2017-10-25 18:04:31 -07:00
|
|
|
priv->info = NULL;
|
2016-10-25 16:54:29 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
EINA_LIST_FREE(priv->files, info)
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_info_free(info, EINA_FALSE);
|
2015-04-05 06:19:45 -07:00
|
|
|
|
2019-02-23 05:57:19 -08:00
|
|
|
eina_stringshare_replace(&priv->path, NULL);
|
2017-10-25 18:04:31 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_destructor(efl_super(obj, MY_CLASS));
|
2015-04-05 06:19:45 -07:00
|
|
|
}
|
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
static void
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_object_invalidate(Eo *obj , Efl_Io_Model_Data *priv)
|
2016-06-05 16:52:52 -07:00
|
|
|
{
|
2019-02-23 05:57:19 -08:00
|
|
|
// This has to be done first, to make sure that the automatic
|
|
|
|
// del is not done anymore. Or it would lead to too much
|
|
|
|
// unref when stopping async thread (During invalidate, we
|
|
|
|
// are already in the process of doing an implicit del).
|
|
|
|
efl_invalidate(efl_super(obj, EFL_IO_MODEL_CLASS));
|
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
_efl_io_model_efl_model_monitor_del(priv);
|
2016-06-05 16:52:52 -07:00
|
|
|
|
2017-10-25 18:04:31 -07:00
|
|
|
// Unlink the object from the parent
|
2019-05-29 06:23:29 -07:00
|
|
|
if (priv->info && priv->info->object)
|
2019-02-23 05:57:19 -08:00
|
|
|
{
|
|
|
|
efl_wref_del(priv->info->object, &priv->info->object);
|
|
|
|
priv->info->object = NULL;
|
|
|
|
}
|
2017-10-25 18:04:31 -07:00
|
|
|
if (priv->request.del)
|
2016-06-05 16:52:52 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
if (!ecore_thread_wait(priv->request.del->thread, 0.1))
|
2016-06-05 16:52:52 -07:00
|
|
|
{
|
2017-10-25 18:04:31 -07:00
|
|
|
ecore_thread_cancel(priv->request.del->thread);
|
|
|
|
ecore_thread_wait(priv->request.del->thread, 0.1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (priv->request.move)
|
|
|
|
{
|
|
|
|
if (!ecore_thread_wait(priv->request.move->thread, 0.1))
|
|
|
|
{
|
|
|
|
ecore_thread_cancel(priv->request.move->thread);
|
|
|
|
ecore_thread_wait(priv->request.move->thread, 0.1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (priv->request.stat)
|
|
|
|
{
|
|
|
|
if (!ecore_thread_wait(priv->request.stat->thread, 0.1))
|
|
|
|
{
|
|
|
|
ecore_thread_cancel(priv->request.stat->thread);
|
|
|
|
ecore_thread_wait(priv->request.stat->thread, 0.1);
|
2016-06-05 16:52:52 -07:00
|
|
|
}
|
|
|
|
}
|
2016-10-05 04:53:26 -07:00
|
|
|
}
|
|
|
|
|
efl_model : rename all efl_model based classes.
Summary:
As the result of discussion in T7458,
we need to rename all efl_model based classes with efl_XXX_Model sequence.
I've run few vote for this, see V42, V43
few classes are totally renamed as our consideration of misnaming.
| Efl.Model_Loop | Efl.Loop_Model |
| Efl.Model_Item | Efl.Generic_Model |
| Efl.Model_Container | Efl.Container_Model |
| Efl.Model_Container_Item | Efl.Container_Model_Item |
| Efl.Model_Composite | Efl.Composite_Model |
| Efl.Model_Composite_Boolean | Efl.Boolean_Model |
| Efl.Model_Composite_Boolean_Chlidren | Efl.Boolean_Model_Item |
| Efl.Model_Composite_Selection | Efl.Select_Model |
| Efl.Model_Composite_Selection_Chlidren | Efl.Select_Model_Item |
| Efl.Model_View | Efl.View_Model |
| Eio.Model | Efl.Io.Model |
| Efl.Ui.Model_State | Efl.Ui.State_Model |
| Efl.Ui.Model_Size | Efl.Ui.Size_Model |
| Efl.Ui.Model_Exact | Efl.Ui.Exact_Model |
| Efl.Ui.Model_Average | Efl.Ui.Average_Model |
| Efl.Ui.Model_Homogeneous | Efl.Ui.Homogeneous_Model |
I worried about Efl.Io.Model changes, cause it is widely used,
but as I tested, there is no issue found yet.
Eldbus.Model also may can changed Efl.Dbus.Model,
but I cannot found any class who using Efl.Dbus namespace,
so I left it future work.
Test Plan:
Run the Make Test,
it works well except Efl test about selection.
there are class inheritance problem exist in select_model,
I reported it and will fix it in another patch.
Reviewers: cedric, felipealmeida, woohyun, Hermet
Reviewed By: cedric
Subscribers: lauromoura
Tags: #efl, #do_not_merge
Differential Revision: https://phab.enlightenment.org/D7533
2019-01-30 20:35:34 -08:00
|
|
|
#include "efl_io_model.eo.c"
|