Commit c77c9422 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port away from KToolInvokation

See https://phabricator.kde.org/T12185
parent 0090b9d0
......@@ -25,7 +25,7 @@
#include <KLocalizedString>
#include <KNotification>
#include <KToolInvocation>
#include <KIO/CommandLauncherJob>
#include <KCupsRequest.h>
......@@ -165,10 +165,10 @@ void NewPrinterNotification::findDriver()
// This function will show the PPD browser dialog
// to choose a better PPD to the already added printer
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), {
QLatin1String("--change-ppd"),
printerName
});
auto job = new KIO::CommandLauncherJob(QStringLiteral("kde-add-printer"), {QStringLiteral("--change-ppd"), printerName});
job->setDesktopName(QStringLiteral("org.kde.kde-add-printer"));
job->start();
}
void NewPrinterNotification::setupPrinterNotification(KNotification *notify, const QString &make, const QString &model, const QString &description, const QString &arg)
......@@ -190,10 +190,9 @@ void NewPrinterNotification::setupPrinterNotification(KNotification *notify, con
// This function will show the PPD browser dialog
// to choose a better PPD, queue name, location
// in this case the printer was not added
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"), {
QLatin1String("--new-printer-from-device"),
arg
});
auto job = new KIO::CommandLauncherJob(QStringLiteral("kde-add-printer"), {QLatin1String("--new-printer-from-device"), arg});
job->setDesktopName(QStringLiteral("org.kde.PrintQueue"));
job->start();
});
notify->sendEvent();
......
......@@ -31,7 +31,7 @@
#include <KMessageBox>
#include <KAboutData>
#include <KToolInvocation>
#include <KIO/CommandLauncherJob>
#include <QIcon>
#include <QMenu>
......@@ -250,14 +250,14 @@ void PrintKCM::update()
void PrintKCM::on_addTB_clicked()
{
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"),
{ QLatin1String("--add-printer") });
auto job = new KIO::CommandLauncherJob(QStringLiteral("kde-add-printer"), { QStringLiteral("--add-printer") });
job->start();
}
void PrintKCM::addClass()
{
KToolInvocation::kdeinitExec(QLatin1String("kde-add-printer"),
{ QLatin1String("--add-class") });
auto job = new KIO::CommandLauncherJob(QStringLiteral("kde-add-printer"), { QStringLiteral("--add-class") });
job->start();
}
void PrintKCM::on_removeTB_clicked()
......
......@@ -30,7 +30,8 @@
#include <QMenu>
#include <QProcess>
#include <KToolInvocation>
#include <KIO/CommandLauncherJob>
#define PRINTER_ICON_SIZE 128
Q_DECLARE_METATYPE(QList<int>)
......@@ -65,7 +66,8 @@ PrinterDescription::~PrinterDescription()
void PrinterDescription::on_openQueuePB_clicked()
{
KToolInvocation::kdeinitExec(QLatin1String("kde-print-queue"), { m_destName });
auto job = new KIO::CommandLauncherJob(QStringLiteral("kde-print-queue"), { m_destName });
job->start();
}
void PrinterDescription::on_defaultCB_clicked()
......
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