Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Print Manager
Commits
c77c9422
Commit
c77c9422
authored
Sep 11, 2020
by
Nicolas Fella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port away from KToolInvokation
See
https://phabricator.kde.org/T12185
parent
0090b9d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
print-manager-kded/NewPrinterNotification.cpp
print-manager-kded/NewPrinterNotification.cpp
+8
-9
printer-manager-kcm/PrintKCM.cpp
printer-manager-kcm/PrintKCM.cpp
+5
-5
printer-manager-kcm/PrinterDescription.cpp
printer-manager-kcm/PrinterDescription.cpp
+4
-2
No files found.
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