- QDBusReply<QList<AppInfo>> reply = proxy.call("getAvailableApps");
- if (reply.isValid()) {
- // FIXME: Is the order from dbus the one we want to use?!
- for (auto const &i: reply.value()) {
- auto const name = i.name().split(" ").front().toUpper();
- auto const icon = get_icon_name(i);
- data.append(AppInfo(icon, name, i.id()));
- }
- } else {
- qDebug() << "getAvailableApps() reply is INVALID!";
+ QString apps = afm_user_daemon_proxy->runnables(QStringLiteral(""));
+ QJsonDocument japps = QJsonDocument::fromJson(apps.toUtf8());
+ 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);
+ this->data.append(AppInfo(icon, name, id));
+ qDebug() << "name:" << name << "icon:" << icon << "id:" << id;