diff options
author | 2018-11-22 14:48:25 +0900 | |
---|---|---|
committer | 2018-11-22 14:48:25 +0900 | |
commit | 94db06ff082d2b5e1ad99ed52c844dcec0d070ca (patch) | |
tree | aafd38d58cde9f24055df218b970e2bf493a042c /app/src/appinfo.cpp | |
parent | 31e4ddecb2e704ab81303568102f786ea727d0cf (diff) |
change blank icons
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; } |