Commit 5418bddf authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to new KIO::CommandLauncherJob

parent 20e44a42
......@@ -201,6 +201,14 @@
#include <gpgme++/keylistresult.h>
#include <gpgme++/key.h>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 70, 0)
#include <KDialogJobUiDelegate>
#include <KIO/CommandLauncherJob>
#endif
using Sonnet::DictionaryComboBox;
using MailTransport::TransportManager;
using MailTransport::Transport;
......@@ -1988,7 +1996,14 @@ void KMComposerWin::addAttach(KMime::Content *msgPart)
void KMComposerWin::slotAddressBook()
{
KRun::runCommand(QStringLiteral("kaddressbook"), window());
#if KIO_VERSION < QT_VERSION_CHECK(5, 70, 0)
KRun::runCommand(QStringLiteral("kaddressbook"), this);
#else
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kaddressbook"), {}, this);
job->setDesktopName(QStringLiteral("org.kde.kaddressbook"));
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->start();
#endif
}
void KMComposerWin::slotInsertFile()
......
......@@ -28,6 +28,12 @@
#include "sendlateragentinterface.h"
#include "followupreminderinterface.h"
#include <MailCommon/FilterManager>
#include <kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 70, 0)
#include <KDialogJobUiDelegate>
#include <KIO/CommandLauncherJob>
#endif
#include <QProcess>
#include "kmail_debug.h"
......@@ -104,7 +110,14 @@ void KMLaunchExternalComponent::slotExportData()
void KMLaunchExternalComponent::slotRunAddressBook()
{
#if KIO_VERSION < QT_VERSION_CHECK(5, 70, 0)
KRun::runCommand(QStringLiteral("kaddressbook"), mParentWidget->window());
#else
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(QStringLiteral("kaddressbook"), {}, this);
job->setDesktopName(QStringLiteral("org.kde.kaddressbook"));
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, mParentWidget->window()));
job->start();
#endif
}
void KMLaunchExternalComponent::slotImport()
......
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