efl_ui_image: fixed elm_image_preload_disabled_set api is not working when it is... 44/236044/1
authorTaehyub Kim <taehyub.kim@samsung.com>
Fri, 12 Jun 2020 07:14:56 +0000 (16:14 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Fri, 12 Jun 2020 07:18:53 +0000 (16:18 +0900)
Summary:
when elm_image_preload_disabled_set(img, EINA_TRUE) is called before file set.
The image preload is not canceled, because the function will be returned since the image is not loaded.
so preload disabled api is fixed to work even if it is called before file set.
@fix

Reviewers: Hermet, kimcinoo, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11969

Change-Id: I72e559314dbe494bbcf1dddf91f309ff8772780c

src/lib/elementary/efl_ui_image.c

index 50156b2..2ae47c8 100644 (file)
@@ -2568,7 +2568,12 @@ elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disable)
    EFL_UI_IMAGE_CHECK(obj);
    EFL_UI_IMAGE_DATA_GET(obj, sd);
 
-   if (sd->edje || !sd->img) return;
+   if (sd->edje) return;
+   if (!sd->img)
+     {
+        if (disable) sd->preload_status = EFL_UI_IMAGE_PRELOAD_DISABLED;
+        return;
+     }
 
    if (disable)
      {