summaryrefslogtreecommitdiff
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
parentf975cdf51366448a64bb162a8641c41bdd435b04 (diff)
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
-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,
2176 const char *_path) 2176 const char *_path)
2177{ 2177{
2178 ELM_FILESELECTOR_INTERFACE_CHECK(obj); 2178 ELM_FILESELECTOR_INTERFACE_CHECK(obj);
2179 const Eo_Class *cls = eo_class_get(obj);
2180 if (cls == ELM_FILESELECTOR_CLASS)
2181 _elm_fileselector_path_set_internal(obj, _path);
2182 else if (cls == ELM_FILESELECTOR_ENTRY_CLASS)
2183 _elm_fileselector_entry_path_set_internal(obj, _path);
2184 else if (cls == ELM_FILESELECTOR_BUTTON_CLASS)
2185 _elm_fileselector_button_path_set_internal(obj, _path);
2186 else
2187 ERR("Unknown Elm.Fileselector class");
2188}
2189
2190void
2191_elm_fileselector_path_set_internal(Evas_Object *obj, const char *_path)
2192{
2179 Eio_Model *model = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eo_self, _path)); 2193 Eio_Model *model = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eo_self, _path));
2180 if (!model) 2194 if (!model)
2181 { 2195 {
@@ -2196,6 +2210,23 @@ EAPI const char *
2196elm_fileselector_path_get(const Evas_Object *obj) 2210elm_fileselector_path_get(const Evas_Object *obj)
2197{ 2211{
2198 ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL); 2212 ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
2213 const Eo_Class *cls = eo_class_get(obj);
2214 if (cls == ELM_FILESELECTOR_CLASS)
2215 return _elm_fileselector_path_get_internal(obj);
2216 else if (cls == ELM_FILESELECTOR_ENTRY_CLASS)
2217 return _elm_fileselector_entry_path_get_internal(obj);
2218 else if (cls == ELM_FILESELECTOR_BUTTON_CLASS)
2219 return _elm_fileselector_button_path_get_internal(obj);
2220 else
2221 {
2222 ERR("Unknown Elm.Fileselector class");
2223 return NULL;
2224 }
2225}
2226
2227const char *
2228_elm_fileselector_path_get_internal(const Evas_Object *obj)
2229{
2199 ELM_FILESELECTOR_DATA_GET(obj, sd); 2230 ELM_FILESELECTOR_DATA_GET(obj, sd);
2200 return sd->path; 2231 return sd->path;
2201} 2232}
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
323void 323void
324_elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path) 324_elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path)
325{ 325{
326 ELM_FILESELECTOR_INTERFACE_CHECK(obj);
327 ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN(obj, sd); 326 ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN(obj, sd);
328 327
329 Efl_Model *model = eo_add(EIO_MODEL_CLASS, NULL, eio_model_path_set(eo_self, path)); 328 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)
345EINA_DEPRECATED EAPI void 344EINA_DEPRECATED EAPI void
346elm_fileselector_button_path_set(Evas_Object *obj, const char *path) 345elm_fileselector_button_path_set(Evas_Object *obj, const char *path)
347{ 346{
347 ELM_FILESELECTOR_INTERFACE_CHECK(obj);
348 _elm_fileselector_button_path_set_internal(obj, path); 348 _elm_fileselector_button_path_set_internal(obj, path);
349} 349}
350 350
@@ -373,7 +373,6 @@ _elm_fileselector_button_elm_interface_fileselector_model_set(Eo *obj EINA_UNUSE
373const char * 373const char *
374_elm_fileselector_button_path_get_internal(const Evas_Object *obj) 374_elm_fileselector_button_path_get_internal(const Evas_Object *obj)
375{ 375{
376 ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
377 ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN_VAL(obj, sd, NULL); 376 ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
378 return sd->fsd.path; 377 return sd->fsd.path;
379} 378}
@@ -381,6 +380,7 @@ _elm_fileselector_button_path_get_internal(const Evas_Object *obj)
381EINA_DEPRECATED EAPI const char * 380EINA_DEPRECATED EAPI const char *
382elm_fileselector_button_path_get(const Evas_Object *obj) 381elm_fileselector_button_path_get(const Evas_Object *obj)
383{ 382{
383 ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
384 return _elm_fileselector_button_path_get_internal(obj); 384 return _elm_fileselector_button_path_get_internal(obj);
385} 385}
386 386
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,
467 const char *path) 467 const char *path)
468{ 468{
469 ELM_FILESELECTOR_INTERFACE_CHECK(obj); 469 ELM_FILESELECTOR_INTERFACE_CHECK(obj);
470 _elm_fileselector_entry_path_set_internal(obj, path);
471}
472
473void
474_elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path)
475{
470 ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd); 476 ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
471 char *s = elm_entry_utf8_to_markup(path); 477 char *s = elm_entry_utf8_to_markup(path);
472 if (s) 478 if (s)
@@ -511,6 +517,12 @@ EINA_DEPRECATED EAPI const char *
511elm_fileselector_entry_path_get(const Evas_Object *obj) 517elm_fileselector_entry_path_get(const Evas_Object *obj)
512{ 518{
513 ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL); 519 ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
520 return _elm_fileselector_entry_path_get_internal(obj);
521}
522
523const char *
524_elm_fileselector_entry_path_get_internal(const Evas_Object *obj)
525{
514 ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL); 526 ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
515 free(sd->path); 527 free(sd->path);
516 sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry)); 528 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 @@
13 } 13 }
14 14
15void 15void
16_elm_fileselector_path_set_internal(Evas_Object *obj, const char *path);
17
18const char *
19_elm_fileselector_path_get_internal(const Evas_Object *obj);
20
21void
22_elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path);
23
24const char *
25_elm_fileselector_entry_path_get_internal(const Evas_Object *obj);
26
27void
16_elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path); 28_elm_fileselector_button_path_set_internal(Evas_Object *obj, const char *path);
17 29
18const char * 30const char *