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
Change-Id: If64d8d58424b559ea07dba14efb36996484c2fd5
Eina_Bool ret = EINA_FALSE;
EFL_UI_IMAGE_CHECK(obj) EINA_FALSE;
+
+ /* check if previous path is same with new one.
+ and return true if they are same */
+ const char *cur_file_path = efl_file_get(obj);
+ if ((cur_file_path && file) && !strcmp(cur_file_path, file))
+ {
+ const char *cur_group = efl_file_key_get(obj);
+ if (!(cur_group && group && strcmp(cur_group, group)))
+ {
+ if (efl_file_loaded_get(obj)) return EINA_TRUE;
+ if (_efl_ui_image_is_remote(file)) return EINA_TRUE;
+ }
+ }
+
ret = efl_file_simple_load(obj, file, group);
efl_canvas_group_change(obj);
return ret;