summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaehyub Kim <taehyub.kim@samsung.com>2020-06-17 21:04:08 +0900
committerHermet Park <chuneon.park@samsung.com>2020-06-17 21:04:08 +0900
commit794c52d2009b603b89eb4da53afc7ab8f9c5547d (patch)
tree3c410ba855b724da360be4742a8a6f3869b53adb
parentb3bc1240a6c019842a7a3e0fbb8a7a99168020ea (diff)
elm_image: keep backword compatibility for elm_image_file_set API when setting url file set twice
Summary: when trying to set file using url path twice, the second api call's return value is EINA_FALSE since image obj has already has same file path. After applying Efl.File interface, the behavior is changed compared to before. both of the return values should be EINA_TRUE. @fix ex) Eina_Bool ret1, ret2; ret1 = elm_image_file_set(image, "http://sameurl/image.jpg", NULL); ret2 = elm_image_file_set(image, "http://sameurl/image.jpg", NULL); ret1 and ret2 should be EINA_TURE Test Plan: 1. call elm_image_file_set api with same url path 2. see the return value Reviewers: Hermet, kimcinoo, jsuya Reviewed By: Hermet Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11979
-rw-r--r--src/lib/elementary/efl_ui_image.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 5bf297854c..d9166ee7fd 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -2453,6 +2453,20 @@ elm_image_file_set(Evas_Object *obj, const char *file, const char *group)
2453 Eina_Bool ret = EINA_FALSE; 2453 Eina_Bool ret = EINA_FALSE;
2454 2454
2455 EFL_UI_IMAGE_CHECK(obj) EINA_FALSE; 2455 EFL_UI_IMAGE_CHECK(obj) EINA_FALSE;
2456
2457 /* check if previous path is same with new one.
2458 and return true if they are same */
2459 const char *cur_file_path = efl_file_get(obj);
2460 if ((cur_file_path && file) && !strcmp(cur_file_path, file))
2461 {
2462 const char *cur_group = efl_file_key_get(obj);
2463 if (!(cur_group && group && strcmp(cur_group, group)))
2464 {
2465 if (efl_file_loaded_get(obj)) return EINA_TRUE;
2466 if (_efl_ui_image_is_remote(file)) return EINA_TRUE;
2467 }
2468 }
2469
2456 ret = efl_file_simple_load(obj, file, group); 2470 ret = efl_file_simple_load(obj, file, group);
2457 efl_canvas_group_change(obj); 2471 efl_canvas_group_change(obj);
2458 return ret; 2472 return ret;