diff options
Diffstat (limited to 'launcher/src/homescreenhandler.cpp')
-rw-r--r-- | launcher/src/homescreenhandler.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/launcher/src/homescreenhandler.cpp b/launcher/src/homescreenhandler.cpp index 9cf7e61..33987dd 100644 --- a/launcher/src/homescreenhandler.cpp +++ b/launcher/src/homescreenhandler.cpp @@ -47,10 +47,30 @@ void HomescreenHandler::tapShortcut(QString application_id) } } +int HomescreenHandler::getRunnablesCount(void) +{ + int apps = 0; + + QDBusPendingReply<QVariantList> reply = applaunch_iface->listApplications(true); + reply.waitForFinished(); + + if (reply.isError()) { + HMI_ERROR("Launcher","Unable to retrieve application list: %s", + reply.error().message().toStdString().c_str()); + return apps; + } else { + QVariantList applist_variant = reply.value(); + for (auto &v: applist_variant) + apps++; + } + + return apps; +} + void HomescreenHandler::getRunnables(void) { - struct json_object *json_applist; - QString applist; + struct json_object *json_applist; + QString applist; QStringList apps; QDBusPendingReply<QVariantList> reply = applaunch_iface->listApplications(true); |