Fixed to show default thumbnail if the icon path is wrong 52/44852/1 accepted/tizen/tv/20150730.014423 submit/tizen/20150729.122120
authorHyojung Jo <hj903.jo@samsung.com>
Tue, 28 Jul 2015 11:48:09 +0000 (20:48 +0900)
committerHyojung Jo <hj903.jo@samsung.com>
Tue, 28 Jul 2015 11:48:09 +0000 (20:48 +0900)
Change-Id: Ia1a49ae03a4af316546a25bf186926af8fbb615b
Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
include/define.h
res/images/ico_default.png [new file with mode: 0644]
src/data/app.c
src/grid/grid_myapps.c

index 499e77b..887b7fe 100644 (file)
@@ -96,6 +96,7 @@
 #define SIZE_SORT_BOX_PAD_V 0
 
 /* Image */
+#define DEFAULT_APP_ICON_PNG IMGDIR"/ico_default.png"
 #define FAVORITE_ICON_PNG "ic_thumbnail_favorite_01.png"
 #define BROWSER_ICON_PNG IMGDIR"/ic_apps_web.png"
 
diff --git a/res/images/ico_default.png b/res/images/ico_default.png
new file mode 100644 (file)
index 0000000..30d1110
Binary files /dev/null and b/res/images/ico_default.png differ
index e6ce6b7..cc65a3e 100644 (file)
@@ -54,8 +54,9 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data)
        if (pkgmgrinfo_appinfo_get_label(handle, &name) != PMINFO_R_OK)
                return -1;
 
-       if (pkgmgrinfo_appinfo_get_icon(handle, &icon) != PMINFO_R_OK)
-               return -1;
+       if (pkgmgrinfo_appinfo_get_icon(handle, &icon) != PMINFO_R_OK) {
+               return 0;
+       }
 
        r = app_contents_favorite_check(CONTENTS_APP, appid, &is_favorite);
        if (r != APP_CONTENTS_ERROR_NONE)
index b146480..34b4f6c 100644 (file)
@@ -78,7 +78,7 @@ static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part)
 {
        struct app_data *adata;
        Evas_Object *img, *ly, *icon_bg, *text_bg;
-       char *icon;
+       char *icon, *img_path;
        int idx;
 
        if (!data || !obj) {
@@ -97,12 +97,14 @@ static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part)
                }
 
                if (!icon || !strcmp(icon, STR_NULL))
-                       /* FIXME: The default icon image should be registerd. */
-                       elm_image_file_set(img, NULL, NULL);
+                       img_path = DEFAULT_APP_ICON_PNG;
                else if (!strcmp(get_app_id(adata), STR_BROWSER_ID))
-                       elm_image_file_set(img, BROWSER_ICON_PNG, NULL);
+                       img_path = BROWSER_ICON_PNG;
                else
-                       elm_image_file_set(img, icon, NULL);
+                       img_path = icon;
+
+               if (!elm_image_file_set(img, img_path, NULL))
+                       elm_image_file_set(img, DEFAULT_APP_ICON_PNG, NULL);
 
                return img;
        } else if (!strcmp(part, PART_THUMB_BG)) {