elementary: fix legacy path set/get for Fileselector specializations
Fix legacy functions elm_fileselector_path_get and elm_fileselector_path_set. Make these functions call the correct function when called with a specialization of Elm.Fileselector (instead of the base class function). Create internal versions of path set/get functions to avoid warnings about deprecated function calls. Fix T4198 @fix
This commit is contained in:
parent
f975cdf513
commit
7efa27faed
|
@ -2176,6 +2176,20 @@ elm_fileselector_path_set(Evas_Object *obj,
|
|||
const char *_path)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
||||
const Eo_Class *cls = eo_class_get(obj);
|
||||
if (cls == ELM_FILESELECTOR_CLASS)
|
||||
_elm_fileselector_path_set_internal(obj, _path);
|
||||
else if (cls == ELM_FILESELECTOR_ENTRY_CLASS)
|
||||
_elm_fileselector_entry_path_set_internal(obj, _path);
|
||||
else if (cls == ELM_FILESELECTOR_BUTTON_CLASS)
|
||||
_elm_fileselector_button_path_set_internal(obj, _path);
|
||||
else
|
||||
ERR("Unknown Elm.Fileselector class");
|
||||
}
|
||||
|
||||
void
|
||||
_elm_fileselector_path_set_internal(Evas_Object *obj, const char *_path)
|
||||
{
|
||||
Eio_Model *model = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eo_self, _path));
|
||||
if (!model)
|
||||
{
|
||||
|
@ -2196,6 +2210,23 @@ EAPI const char *
|
|||
elm_fileselector_path_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
||||
const Eo_Class *cls = eo_class_get(obj);
|
||||
if (cls == ELM_FILESELECTOR_CLASS)
|
||||
return _elm_fileselector_path_get_internal(obj);
|
||||
else if (cls == ELM_FILESELECTOR_ENTRY_CLASS)
|
||||
return _elm_fileselector_entry_path_get_internal(obj);
|
||||
else if (cls == ELM_FILESELECTOR_BUTTON_CLASS)
|
||||
return _elm_fileselector_button_path_get_internal(obj);
|
||||
else
|
||||
{
|
||||
ERR("Unknown Elm.Fileselector class");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
_elm_fileselector_path_get_internal(const Evas_Object *obj)
|
||||
{
|
||||
ELM_FILESELECTOR_DATA_GET(obj, sd);
|
||||
return sd->path;
|
||||
}
|
||||
|
|
|
@ -323,7 +323,6 @@ elm_fileselector_button_window_size_get(const Eo *obj, Evas_Coord *width, Evas_C
|
|||
void
|
||||
_elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
||||
ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN(obj, sd);
|
||||
|
||||
Efl_Model *model = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eo_self, path));
|
||||
|
@ -345,6 +344,7 @@ _elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path)
|
|||
EINA_DEPRECATED EAPI void
|
||||
elm_fileselector_button_path_set(Evas_Object *obj, const char *path)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
||||
_elm_fileselector_button_path_set_internal(obj, path);
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,6 @@ _elm_fileselector_button_elm_interface_fileselector_model_set(Eo *obj EINA_UNUSE
|
|||
const char *
|
||||
_elm_fileselector_button_path_get_internal(const Evas_Object *obj)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
||||
ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
|
||||
return sd->fsd.path;
|
||||
}
|
||||
|
@ -381,6 +380,7 @@ _elm_fileselector_button_path_get_internal(const Evas_Object *obj)
|
|||
EINA_DEPRECATED EAPI const char *
|
||||
elm_fileselector_button_path_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
||||
return _elm_fileselector_button_path_get_internal(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -467,6 +467,12 @@ elm_fileselector_entry_path_set(Evas_Object *obj,
|
|||
const char *path)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
||||
_elm_fileselector_entry_path_set_internal(obj, path);
|
||||
}
|
||||
|
||||
void
|
||||
_elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path)
|
||||
{
|
||||
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
|
||||
char *s = elm_entry_utf8_to_markup(path);
|
||||
if (s)
|
||||
|
@ -511,6 +517,12 @@ EINA_DEPRECATED EAPI const char *
|
|||
elm_fileselector_entry_path_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
||||
return _elm_fileselector_entry_path_get_internal(obj);
|
||||
}
|
||||
|
||||
const char *
|
||||
_elm_fileselector_entry_path_get_internal(const Evas_Object *obj)
|
||||
{
|
||||
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
|
||||
free(sd->path);
|
||||
sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
|
||||
|
|
|
@ -12,6 +12,18 @@
|
|||
return __VA_ARGS__; \
|
||||
}
|
||||
|
||||
void
|
||||
_elm_fileselector_path_set_internal(Evas_Object *obj, const char *path);
|
||||
|
||||
const char *
|
||||
_elm_fileselector_path_get_internal(const Evas_Object *obj);
|
||||
|
||||
void
|
||||
_elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path);
|
||||
|
||||
const char *
|
||||
_elm_fileselector_entry_path_get_internal(const Evas_Object *obj);
|
||||
|
||||
void
|
||||
_elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue