Summary:
I chose CommandLauncherJob rather than ApplicationLauncherJob
because that would require either looking up org.kde.kfind.desktop
(with a risk of failure) or duplicating the icon name...
Test Plan:
commented out the if() block of the slot, to make sure we end
up launching kfind with this code. Then konqueror /, and Ctrl+F.
Reviewers: broulik
Reviewed By: broulik
Differential Revision: https://phabricator.kde.org/D28810
#include <KActionCollection>
#include <KAuthorized>
#include <KConfigGroup>
#include <KActionCollection>
#include <KAuthorized>
#include <KConfigGroup>
+#include <KDialogJobUiDelegate>
#include <KFileItemListProperties>
#include <KIconLoader>
#include <KJobWidgets>
#include <KFileItemListProperties>
#include <KIconLoader>
#include <KJobWidgets>
#include <KMimeTypeEditor>
#include <KNS3/KMoreToolsMenuFactory>
#include <KPluginFactory>
#include <KMimeTypeEditor>
#include <KNS3/KMoreToolsMenuFactory>
#include <KPluginFactory>
+#include <KIO/CommandLauncherJob>
#include <KSharedConfig>
#include <KToolInvocation>
#include <KSharedConfig>
#include <KToolInvocation>
if (!(actions.isEmpty())) {
actions.first()->trigger();
} else {
if (!(actions.isEmpty())) {
actions.first()->trigger();
} else {
- KRun::run(QStringLiteral("kfind"), {url()}, widget());
+ KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kfind"), {url().toString()}, this);
+ job->setDesktopName(QStringLiteral("org.kde.kfind"));
+ job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, widget()));
+ job->start();