Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Print Manager
Commits
c77c9422
Commit
c77c9422
authored
Sep 11, 2020
by
Nicolas Fella
Browse files
Port away from KToolInvokation
See
https://phabricator.kde.org/T12185
parent
0090b9d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
print-manager-kded/NewPrinterNotification.cpp
View file @
c77c9422
...
...
@@ -25,7 +25,7 @@
#include <KLocalizedString>
#include <KNotification>
#include <K
ToolInvocation
>
#include <K
IO/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
();
...
...
printer-manager-kcm/PrintKCM.cpp
View file @
c77c9422
...
...
@@ -31,7 +31,7 @@
#include <KMessageBox>
#include <KAboutData>
#include <K
ToolInvocation
>
#include <K
IO/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
()
...
...
printer-manager-kcm/PrinterDescription.cpp
View file @
c77c9422
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment