diff options
Diffstat (limited to 'app/src/appinfo.cpp')
-rw-r--r-- | app/src/appinfo.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/src/appinfo.cpp b/app/src/appinfo.cpp index b06dd2f..05daad4 100644 --- a/app/src/appinfo.cpp +++ b/app/src/appinfo.cpp @@ -16,7 +16,9 @@ * limitations under the License. */ +#include <QFileInfo> #include "appinfo.h" +#include "config.h" #include "hmi-debug.h" class AppInfo::Private : public QSharedData { @@ -176,6 +178,11 @@ void AppInfo::read(const QJsonObject& json) { d->shortname = json["shortname"].toString(); d->author = json["author"].toString(); d->iconPath = json["icon"].toString(); + QFileInfo fi(d->iconPath); + if(!fi.isFile()){ + d->iconPath = ""; + } + d->state = Launch; } @@ -193,8 +200,13 @@ void AppInfo::readFromServer(const QJsonObject& json) { d->deviceid = json["appDeviceTypeId"].toString(); d->devicename = json["appDeviceTypeName"].toString(); d->createdtime = json["updateDate"].toDouble(); - // d->iconPath = json["icon"].toString(); - d->iconPath = "file:///var/local/lib/afm/applications/launcher/0.1/icon.svg"; + d->iconPath = json["imagePath"].toString(); + + if(json["imagePath"].toString().isEmpty()){ + d->iconPath = ""; + } else { + d->iconPath = getIconUrl(json["imagePath"].toString()); + } d->state = Install; d->progress = 0.0; } |