Commit 519884ab authored by David Faure's avatar David Faure

Port hotplug from KRun::runCommand to CommandLauncherJob.

Summary:
Is there a better way to report error from this code than the dialog box
that KRun used to pop up (and KDialogJobUiDelegate does too)?

Test Plan: Untested.

Reviewers: davidedmundson, sitter, broulik

Reviewed By: broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28988
parent eca2ea2c
......@@ -15,7 +15,8 @@ target_link_libraries(plasma_engine_hotplug
KF5::Solid
KF5::Service
KF5::KIOCore
KF5::KIOWidgets
KF5::KIOWidgets # KDesktopFileActions
KF5::Notifications
KF5::I18n
)
......
......@@ -23,7 +23,8 @@
#include <KLocalizedString>
#include <kmacroexpander.h>
#include <krun.h>
#include <KIO/CommandLauncherJob>
#include <KNotificationJobUiDelegate>
#include <solid/storageaccess.h>
#include <solid/block.h>
......@@ -159,7 +160,11 @@ void DelayedExecutor::delayedExecute(const QString &udi)
MacroExpander mx(device);
mx.expandMacrosShellQuote(exec);
KRun::runCommand(exec, QString(), m_service.icon(), nullptr);
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(exec);
job->setIcon(m_service.icon());
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
job->start();
deleteLater();
}
......
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