diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-11-20 18:29:03 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-11-20 18:29:03 +0900 |
commit | 78d62b2db44043efb397c666622cb04fc0e0f318 (patch) | |
tree | 281a1ce2f275e632b8fe58650f5c55ffbff909d6 /launcher/src/applicationmodel.cpp | |
parent | 4309e1fdcd89e7b9d6ae857628382a297a526ea3 (diff) |
change launcher stylesandbox/zheng_wenlong/ces2019_horizontal
Diffstat (limited to 'launcher/src/applicationmodel.cpp')
-rw-r--r-- | launcher/src/applicationmodel.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp index dd6ae5f..d57d643 100644 --- a/launcher/src/applicationmodel.cpp +++ b/launcher/src/applicationmodel.cpp @@ -32,6 +32,7 @@ class ApplicationModel::Private { public: Private(); + int loadAppInfo(); QList<AppInfo> data; }; @@ -52,8 +53,19 @@ namespace { ApplicationModel::Private::Private() { + int appCount = 0; + while(appCount <= 22) + { + appCount += loadAppInfo(); + HMI_DEBUG("launcher", "appCount = %d", appCount); + } +} + +int ApplicationModel::Private::loadAppInfo() +{ QString apps = afm_user_daemon_proxy->runnables(QStringLiteral("")); QJsonDocument japps = QJsonDocument::fromJson(apps.toUtf8()); + int appCount = 0; for (auto const &app : japps.array()) { QJsonObject const &jso = app.toObject(); auto const name = jso["name"].toString(); @@ -67,25 +79,11 @@ ApplicationModel::Private::Private() !name.contains("OnScreen", Qt::CaseInsensitive)) { this->data.append(AppInfo(icon, name, id)); } + appCount++; HMI_DEBUG("launcher","name: %s icon: %s id: %s.", name.toStdString().c_str(), icon.toStdString().c_str(), id.toStdString().c_str()); } - for (auto const &app : japps.array()) { - QJsonObject const &jso = app.toObject(); - auto const name = jso["name"].toString(); - auto const id = jso["id"].toString(); - auto const icon = get_icon_name(jso); - - // Hide HomeScreen icon itself - if (name != "launcher" && - name != "homescreen" && - name != "HomeScreen" && - !name.contains("OnScreen", Qt::CaseInsensitive)) { - this->data.append(AppInfo(icon, name, id)); - } - - HMI_DEBUG("launcher","name: %s icon: %s id: %s.", name.toStdString().c_str(), icon.toStdString().c_str(), id.toStdString().c_str()); - } + return appCount; } ApplicationModel::ApplicationModel(QObject *parent) |