Commit 73a23e30 authored by David Faure's avatar David Faure
Browse files

Port KRun::runService to KIO::ApplicationLauncherJob

parent f5b05b00
......@@ -34,6 +34,8 @@
#include <QMenu>
#include <KMessageBox>
#include <KRun>
#include <KIO/ApplicationLauncherJob>
#include <KIO/JobUiDelegate>
#include <KShortcutsDialog>
#include <KStandardAction>
#include <QTemporaryFile>
......@@ -543,11 +545,13 @@ void KTNEFMain::openWith(const KService::Ptr &offer)
{
if (!mView->getSelection().isEmpty()) {
KTNEFAttach *attach = mView->getSelection().at(0);
QUrl url = QUrl::fromLocalFile(QLatin1String("file:") + extractTemp(attach));
QList<QUrl> lst;
lst.append(url);
const QUrl url = QUrl::fromLocalFile(extractTemp(attach));
QList<QUrl> lst{url};
if (offer) {
KRun::runService(*offer, lst, this, false);
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob(offer);
job->setUrls(lst);
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->start();
} else {
KRun::displayOpenWithDialog(lst, this, false);
}
......
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