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
PIM
KMail
Commits
8a7cbfd7
Commit
8a7cbfd7
authored
Feb 03, 2022
by
Laurent Montel
😁
Browse files
Use KIO::ApplicationLauncherJob
parent
1d14d63b
Pipeline
#132811
passed with stage
in 4 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kmlaunchexternalcomponent.cpp
View file @
8a7cbfd7
...
...
@@ -18,6 +18,7 @@
#include
<MailCommon/FilterManager>
#include
<KDialogJobUiDelegate>
#include
<KIO/ApplicationLauncherJob>
#include
<KIO/CommandLauncherJob>
#include
<QPointer>
...
...
@@ -83,8 +84,12 @@ void KMLaunchExternalComponent::slotConfigureFollowupReminder()
void
KMLaunchExternalComponent
::
slotStartCertManager
()
{
const
QString
exec
=
QStandardPaths
::
findExecutable
(
QStringLiteral
(
"kleopatra"
));
if
(
exec
.
isEmpty
()
||
!
QProcess
::
startDetached
(
exec
,
QStringList
()))
{
const
KService
::
Ptr
service
=
KService
::
serviceByDesktopName
(
QStringLiteral
(
"org.kde.kleopatra"
));
if
(
service
)
{
auto
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUiDelegate
(
new
KDialogJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
mParentWidget
->
window
()));
job
->
start
();
}
else
{
KMessageBox
::
error
(
mParentWidget
,
i18n
(
"Could not start certificate manager; "
"please make sure you have Kleopatra properly installed."
),
...
...
@@ -94,8 +99,12 @@ void KMLaunchExternalComponent::slotStartCertManager()
void
KMLaunchExternalComponent
::
slotImportWizard
()
{
const
QString
path
=
QStandardPaths
::
findExecutable
(
QStringLiteral
(
"akonadiimportwizard"
));
if
(
path
.
isEmpty
()
||
!
QProcess
::
startDetached
(
path
,
QStringList
()))
{
const
KService
::
Ptr
service
=
KService
::
serviceByDesktopName
(
QStringLiteral
(
"org.kde.akonadiimportwizard"
));
if
(
service
)
{
auto
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUiDelegate
(
new
KDialogJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
mParentWidget
->
window
()));
job
->
start
();
}
else
{
KMessageBox
::
error
(
mParentWidget
,
i18n
(
"Could not start the import wizard. "
"Please make sure you have ImportWizard properly installed."
),
...
...
@@ -105,8 +114,12 @@ void KMLaunchExternalComponent::slotImportWizard()
void
KMLaunchExternalComponent
::
slotExportData
()
{
const
QString
path
=
QStandardPaths
::
findExecutable
(
QStringLiteral
(
"pimdataexporter"
));
if
(
path
.
isEmpty
()
||
!
QProcess
::
startDetached
(
path
,
QStringList
()))
{
const
KService
::
Ptr
service
=
KService
::
serviceByDesktopName
(
QStringLiteral
(
"org.kde.pimdataexporter"
));
if
(
service
)
{
auto
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUiDelegate
(
new
KDialogJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
mParentWidget
->
window
()));
job
->
start
();
}
else
{
KMessageBox
::
error
(
mParentWidget
,
i18n
(
"Could not start
\"
PIM Data Exporter
\"
program. "
"Please check your installation."
),
...
...
Write
Preview
Supports
Markdown
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