aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2016-07-22 18:43:12 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2016-07-27 18:09:23 -0300
commit7efa27faed12dc57f5f44fb635e26482955ca0cf (patch)
tree132b1a43736ae4f260a2f2dadfa5dfa0d5309913 /src/lib/elementary
parentecore-drm2: Silence compiler warning (diff)
downloadefl-7efa27faed12dc57f5f44fb635e26482955ca0cf.tar.gz
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 https://phab.enlightenment.org/T4198 @fix
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elc_fileselector.c31
-rw-r--r--src/lib/elementary/elc_fileselector_button.c4
-rw-r--r--src/lib/elementary/elc_fileselector_entry.c12
-rw-r--r--src/lib/elementary/elm_interface_fileselector.h12
4 files changed, 57 insertions, 2 deletions
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c
index 566aa1e91d..e5c3bafcb2 100644
--- a/src/lib/elementary/elc_fileselector.c
+++ b/src/lib/elementary/elc_fileselector.c
@@ -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;
}
diff --git a/src/lib/elementary/elc_fileselector_button.c b/src/lib/elementary/elc_fileselector_button.c
index 8ae9ecbd27..324808e5c9 100644
--- a/src/lib/elementary/elc_fileselector_button.c
+++ b/src/lib/elementary/elc_fileselector_button.c
@@ -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);
}
diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c
index a0edf250d8..ae4ba755e9 100644
--- a/src/lib/elementary/elc_fileselector_entry.c
+++ b/src/lib/elementary/elc_fileselector_entry.c
@@ -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));
diff --git a/src/lib/elementary/elm_interface_fileselector.h b/src/lib/elementary/elm_interface_fileselector.h
index 731dd517e4..e1c3bc77d2 100644
--- a/src/lib/elementary/elm_interface_fileselector.h
+++ b/src/lib/elementary/elm_interface_fileselector.h
@@ -13,6 +13,18 @@
}
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);
const char *