Commit 9a72b154 authored by David Faure's avatar David Faure
Browse files

akonadi-contacts: port from KRun to KIO::CommandLauncherJob

Test Plan: Untested (it builds)

Reviewers: mlaurent, winterz

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28992
parent 0a39ddea
......@@ -5,7 +5,7 @@ project(Akonadi-Contact VERSION ${PIM_VERSION})
# ECM setup
set(KF5_MIN_VERSION "5.69.0")
set(KF5_MIN_VERSION "5.70.0")
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
......
......@@ -30,7 +30,8 @@
#include <kcontacts/phonenumber.h>
#include <KLocalizedString>
#include <KMessageBox>
#include <KRun>
#include <KDialogJobUiDelegate>
#include <KIO/CommandLauncherJob>
#include <QDesktopServices>
......@@ -79,5 +80,8 @@ void DialPhoneNumberAction::dialNumber(const KContacts::PhoneNumber &number)
command.replace(QLatin1String("%N"), number.number());
command.replace(QLatin1String("%n"), number.normalizedNumber());
KRun::runCommand(command, nullptr);
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(command);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
}
......@@ -29,7 +29,8 @@
#include <kcontacts/phonenumber.h>
#include <KLocalizedString>
#include <KMessageBox>
#include <KRun>
#include <KDialogJobUiDelegate>
#include <KIO/CommandLauncherJob>
#include <QDesktopServices>
#include <QPointer>
......@@ -96,5 +97,8 @@ void SendSmsAction::sendSms(const KContacts::PhoneNumber &phoneNumber)
command.replace(QLatin1String("%t"), QStringLiteral("\"%1\"").arg(message));
//Bug: 293232 In KDE3 We used %F to replace text
command.replace(QLatin1String("%F"), message);
KRun::runCommand(command, nullptr);
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(command);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
}
......@@ -24,7 +24,8 @@
#include "contactactionssettings.h"
#include <kcontacts/address.h>
#include <KRun>
#include <KDialogJobUiDelegate>
#include <KIO/CommandLauncherJob>
#include <QDesktopServices>
......@@ -56,7 +57,9 @@ void ShowAddressAction::showAddress(const KContacts::Address &address)
replaceArguments(commandTemplate, address);
if (!commandTemplate.isEmpty()) {
KRun::runCommand(commandTemplate, nullptr);
KIO::CommandLauncherJob *job = new KIO::CommandLauncherJob(commandTemplate);
job->setUiDelegate(new KDialogJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
}
} else if (ContactActionsSettings::self()->showAddressAction() == ContactActionsSettings::UseGooglemap) {
QString urlTemplate = QStringLiteral("https://maps.google.com/maps?q=%s,%l,%c");
......
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