Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Pim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Pim
Commits
b113d44b
Commit
b113d44b
authored
Aug 01, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix usage of KToolInvocation::startServiceByDesktopPath
parent
675f284d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
kmail/src/tests/ktoolinvocationtest.cpp
kmail/src/tests/ktoolinvocationtest.cpp
+6
-0
korganizer/src/dialog/koeventviewerdialog.cpp
korganizer/src/dialog/koeventviewerdialog.cpp
+20
-10
No files found.
kmail/src/tests/ktoolinvocationtest.cpp
View file @
b113d44b
...
...
@@ -25,6 +25,7 @@
#include <KLocalizedString>
#include <QCommandLineParser>
#include <KToolInvocation>
#include <QStandardPaths>
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -46,6 +47,11 @@ int main(int argc, char **argv)
qDebug
()
<<
" Can not start kmail"
<<
errmsg
;
}
const
QString
desktopFile
=
QStandardPaths
::
locate
(
QStandardPaths
::
ApplicationsLocation
,
QStringLiteral
(
"org.kde.korganizer.desktop"
));
if
(
KToolInvocation
::
startServiceByDesktopPath
(
desktopFile
)
>
0
)
{
qDebug
()
<<
" Can not start korganizer"
;
}
qDebug
()
<<
"kinvocation done."
;
return
0
;
...
...
korganizer/src/dialog/koeventviewerdialog.cpp
View file @
b113d44b
...
...
@@ -25,6 +25,7 @@
#include "koeventviewerdialog.h"
#include "korganizerinterface.h"
#include "korganizer_debug.h"
#include <CalendarSupport/Utils>
#include <CalendarSupport/IncidenceViewer>
...
...
@@ -40,6 +41,7 @@
#include <QPushButton>
#include <KGuiItem>
#include <QVBoxLayout>
#include <QStandardPaths>
KOEventViewerDialog
::
KOEventViewerDialog
(
Akonadi
::
ETMCalendar
*
calendar
,
QWidget
*
parent
)
:
QDialog
(
parent
)
...
...
@@ -102,11 +104,15 @@ void KOEventViewerDialog::editIncidence()
if
(
CalendarSupport
::
hasIncidence
(
item
))
{
// make sure korganizer is running or the part is shown
KToolInvocation
::
startServiceByDesktopPath
(
QStringLiteral
(
"korganizer"
));
OrgKdeKorganizerKorganizerInterface
korganizerIface
(
QStringLiteral
(
"org.kde.korganizer"
),
QStringLiteral
(
"/Korganizer"
),
QDBusConnection
::
sessionBus
());
korganizerIface
.
editIncidence
(
QString
::
number
(
item
.
id
()));
const
QString
desktopFile
=
QStandardPaths
::
locate
(
QStandardPaths
::
ApplicationsLocation
,
QStringLiteral
(
"org.kde.korganizer.desktop"
));
QString
error
;
if
(
KToolInvocation
::
startServiceByDesktopPath
(
desktopFile
,
QStringList
(),
&
error
)
==
0
)
{
OrgKdeKorganizerKorganizerInterface
korganizerIface
(
QStringLiteral
(
"org.kde.korganizer"
),
QStringLiteral
(
"/Korganizer"
),
QDBusConnection
::
sessionBus
());
korganizerIface
.
editIncidence
(
QString
::
number
(
item
.
id
()));
}
else
{
qCWarning
(
KORGANIZER_LOG
)
<<
"Failure starting korganizer:"
<<
error
;
}
}
}
...
...
@@ -116,11 +122,15 @@ void KOEventViewerDialog::showIncidenceContext()
if
(
CalendarSupport
::
hasIncidence
(
item
))
{
// make sure korganizer is running or the part is shown
KToolInvocation
::
startServiceByDesktopPath
(
QStringLiteral
(
"korganizer"
));
OrgKdeKorganizerKorganizerInterface
korganizerIface
(
QStringLiteral
(
"org.kde.korganizer"
),
QStringLiteral
(
"/Korganizer"
),
QDBusConnection
::
sessionBus
());
korganizerIface
.
showIncidenceContext
(
QString
::
number
(
item
.
id
()));
const
QString
desktopFile
=
QStandardPaths
::
locate
(
QStandardPaths
::
ApplicationsLocation
,
QStringLiteral
(
"org.kde.korganizer.desktop"
));
QString
error
;
if
(
KToolInvocation
::
startServiceByDesktopPath
(
desktopFile
,
QStringList
(),
&
error
)
==
0
)
{
OrgKdeKorganizerKorganizerInterface
korganizerIface
(
QStringLiteral
(
"org.kde.korganizer"
),
QStringLiteral
(
"/Korganizer"
),
QDBusConnection
::
sessionBus
());
korganizerIface
.
showIncidenceContext
(
QString
::
number
(
item
.
id
()));
}
else
{
qCWarning
(
KORGANIZER_LOG
)
<<
"Failure starting korganizer:"
<<
error
;
}
}
}
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