Fix getting icon path 57/55757/2 submit/tizen/20151229.074303
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 29 Dec 2015 06:48:10 +0000 (15:48 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 29 Dec 2015 07:22:44 +0000 (16:22 +0900)
this is a workaround.

Change-Id: I32a84fa911978726e54fe3a7622ec0b7b4bc87a0
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/pkgmgrinfo_appinfo.c

index d74cd60..75c1c21 100644 (file)
@@ -253,6 +253,20 @@ static int _appinfo_get_label(sqlite3 *db, const char *appid,
        return PMINFO_R_OK;
 }
 
+static void _appinfo_modify_icon(const char *appid, const char **icon)
+{
+       char buf[PKG_VALUE_STRING_LEN_MAX];
+       const char *tmp;
+
+       if (*icon == NULL || (*icon)[0] == '/' || !strcasecmp(*icon, "(null)"))
+               return;
+
+       tmp = *icon;
+       snprintf(buf, sizeof(buf), "%s%s.png", getIconPath(getuid()), appid);
+       *icon = strdup(buf);
+       free((char *)tmp);
+}
+
 static int _appinfo_get_icon(sqlite3 *db, const char *appid, const char *locale,
                GList **icon)
 {
@@ -289,6 +303,8 @@ static int _appinfo_get_icon(sqlite3 *db, const char *appid, const char *locale,
                }
                idx = 0;
                _save_column_str(stmt, idx++, &info->text);
+               /* FIXME: this is a workaround. this must be removed later */
+               _appinfo_modify_icon(appid, &info->text);
                _save_column_str(stmt, idx++, &info->lang);
                *icon = g_list_append(*icon, info);
        }