Commit 16767a2c authored by David Faure's avatar David Faure

lookandfeel kcm: port from KRun::runApplication to KIO::ApplicationLauncherJob

Summary:
I used the dialog ui delegate because this is a KCM, even though it
seems to use QtQuick itself.

Test Plan:
Builds. `kcmshell5 lookandfeel` seems to add stuff to autostart
only for some themes I don't have (commit 49ae81f2 talks about lattedock
or conky).

Reviewers: broulik, ngraham, crossi, mart, davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29125
parent eeab7995
......@@ -27,8 +27,9 @@
#include <KSharedConfig>
#include <KGlobalSettings>
#include <KIconLoader>
#include <KIO/ApplicationLauncherJob>
#include <KAutostart>
#include <KRun>
#include <KDialogJobUiDelegate>
#include <KService>
#include <QDBusConnection>
......@@ -388,12 +389,14 @@ void KCMLookandFeel::save()
const QStringList autostartServices = cg.readEntry("Services", QStringList());
for (const QString &serviceFile : autostartServices) {
KService service(serviceFile + QStringLiteral(".desktop"));
KService::Ptr service{new KService(serviceFile + QStringLiteral(".desktop"))};
KAutostart as(serviceFile);
as.setCommand(service.exec());
as.setCommand(service->exec());
as.setAutostarts(true);
if (qEnvironmentVariableIsSet("KDE_FULL_SESSION")) {
KRun::runApplication(service, {}, nullptr);
auto *job = new KIO::ApplicationLauncherJob(service);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment