last_image = _get_last_image_from_db();
WALLPAPERUI_DBG("last_image == %s", last_image);
+ if ((last_image == NULL && strstr(ad->last_preview_img_path, "no_gallery_bg.png") == NULL)
+ || (last_image != NULL && strcmp(last_image, ad->last_preview_img_path) != 0)) {
+ //if last image was changed
+ Thumbnail *item = NULL;
+
+ Elm_Object_Item *object_item = elm_gengrid_first_item_get(ad->gengrid);
+
+ while (object_item) {
+ item = (Thumbnail *)elm_object_item_data_get(object_item);
+
+ if (item && item->type == WALLPAPER_TYPE_GALLERY) {
+ free(item->path);
+ if (last_image != NULL) {
+ item->path = strdup(last_image);
+ } else {
+ item->path = wallpaper_ui_service_get_icon_path("no_gallery_bg.png");
+ }
+ elm_gengrid_item_update(item->item);
+ break;
+ }
+ object_item = elm_gengrid_item_next_get(object_item);
+ }
- if (last_image != NULL) {
- elm_image_file_set(ad->preview_image, last_image, NULL);
- free(last_image);
- last_image = NULL;
- } else {
- char *iconPath = wallpaper_ui_service_get_icon_path("no_gallery_bg.png");
- elm_image_file_set(ad->preview_image, iconPath, NULL);
- free(iconPath);
}
- evas_object_show(ad->preview_image);
+
+ free(last_image);
WALLPAPERUI_TRACE_END;
}