mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
DolphinPart: port dolphin's last use of KRun::run to CommandLauncherJob.
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
This commit is contained in:
parent
8fa3e7c145
commit
ec2c69726a
|
@ -34,6 +34,7 @@
|
||||||
#include <KActionCollection>
|
#include <KActionCollection>
|
||||||
#include <KAuthorized>
|
#include <KAuthorized>
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
|
#include <KDialogJobUiDelegate>
|
||||||
#include <KFileItemListProperties>
|
#include <KFileItemListProperties>
|
||||||
#include <KIconLoader>
|
#include <KIconLoader>
|
||||||
#include <KJobWidgets>
|
#include <KJobWidgets>
|
||||||
|
@ -42,7 +43,7 @@
|
||||||
#include <KMimeTypeEditor>
|
#include <KMimeTypeEditor>
|
||||||
#include <KNS3/KMoreToolsMenuFactory>
|
#include <KNS3/KMoreToolsMenuFactory>
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
#include <KRun>
|
#include <KIO/CommandLauncherJob>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
#include <KToolInvocation>
|
#include <KToolInvocation>
|
||||||
|
|
||||||
|
@ -546,7 +547,10 @@ void DolphinPart::slotFindFile()
|
||||||
if (!(actions.isEmpty())) {
|
if (!(actions.isEmpty())) {
|
||||||
actions.first()->trigger();
|
actions.first()->trigger();
|
||||||
} else {
|
} 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue