mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
Port KRun::run usage to run another Dolphin process, to ApplicationLauncherJob
Test Plan: Opening a new window works Reviewers: elvisangelaccio, ngraham, meven Reviewed By: elvisangelaccio, meven Subscribers: meven, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28807
This commit is contained in:
parent
a205210508
commit
30257697e2
|
@ -23,7 +23,9 @@
|
|||
#include "dolphindebug.h"
|
||||
#include "dolphinmainwindowinterface.h"
|
||||
|
||||
#include <KRun>
|
||||
#include <KDialogJobUiDelegate>
|
||||
#include <KIO/ApplicationLauncherJob>
|
||||
#include <KService>
|
||||
#include <KWindowSystem>
|
||||
|
||||
#include <QApplication>
|
||||
|
@ -60,13 +62,11 @@ void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const Open
|
|||
if (!urls.isEmpty()) {
|
||||
command.append(QLatin1String(" %U"));
|
||||
}
|
||||
KRun::run(
|
||||
command,
|
||||
urls,
|
||||
window,
|
||||
QApplication::applicationDisplayName(),
|
||||
QApplication::windowIcon().name()
|
||||
);
|
||||
KService::Ptr service(new KService(QApplication::applicationDisplayName(), command, QApplication::windowIcon().name()));
|
||||
auto *job = new KIO::ApplicationLauncherJob(service, window);
|
||||
job->setUrls(urls);
|
||||
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, window));
|
||||
job->start();
|
||||
}
|
||||
|
||||
bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFiles, bool splitView, const QString& preferredService)
|
||||
|
|
Loading…
Reference in a new issue