summaryrefslogtreecommitdiffstats
path: root/launcher/src/applicationmodel.cpp
diff options
context:
space:
mode:
authorArnaud Ferraris <arnaud.ferraris@collabora.com>2021-12-10 12:44:27 +0100
committerArnaud Ferraris <arnaud.ferraris@collabora.com>2021-12-20 21:08:46 +0100
commit9495545c38d5e72014cba05f8ea79c98ed3321a1 (patch)
tree51a4fcd709e772c4ed824ed9757c17d3463ef4f2 /launcher/src/applicationmodel.cpp
parent20cd96660d4bfb44e0be5695f71a92d5fb53a143 (diff)
launcher: rely on applaunchd for application startupmarlin_12.91.0marlin/12.91.012.91.0
In the new App FW setup, `launcher` should only instruct `applaunchd` to execute an application. In order to do so, it must first build a list of available applications by looking for and parsing `.desktop` files in relevant folders. Then, when an application must be started, it has to call the corresponding `applaunchd` method through D-Bus, which will then handle the application startup using either command line execution or D-Bus activation. Bug-AGL: SPEC-4159 SPEC-4160 Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Change-Id: Ie2f55a5acb64ed90aa6aafb687c927d87f6cc0aa
Diffstat (limited to 'launcher/src/applicationmodel.cpp')
-rw-r--r--launcher/src/applicationmodel.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp
index 42982d5..1af4366 100644
--- a/launcher/src/applicationmodel.cpp
+++ b/launcher/src/applicationmodel.cpp
@@ -40,13 +40,10 @@ public:
namespace {
QString get_icon_name(QJsonObject const &i)
{
- QString icon = i["name"].toString().toLower();
-
- if ( !QFile::exists(QString(":/images/%1_active.svg").arg(icon)) ||
- !QFile::exists(QString(":/images/%1_inactive.svg").arg(icon)) )
- {
+ QString icon = i["icon"].toString();
+ fprintf(stderr, "Looking for icon %s\n", icon.toLocal8Bit().data());
+ if ( !QFile::exists(icon) )
icon = "blank";
- }
return icon;
}
}
@@ -63,9 +60,13 @@ void ApplicationModel::Private::addApp(QString icon, QString name, QString id)
return;
}
- QString _icon = name.toLower();
- if ( !QFile::exists(QString(":/images/%1_active.svg").arg(_icon)) ||
- !QFile::exists(QString(":/images/%1_inactive.svg").arg(_icon)) )
+ QString _icon;
+ if ( QFile::exists(icon) )
+ {
+ _icon = QString("file:%1").arg(icon);
+ fprintf(stderr, "using icon '%s'\n", _icon.toLocal8Bit().data());
+ }
+ else
{
_icon = "blank";
}