Commit 6db10677 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compiles with last kf5

parent 0d1239bf
Pipeline #59779 canceled with stage
...@@ -1000,7 +1000,7 @@ void AlarmDialog::keyPressEvent(QKeyEvent *e) ...@@ -1000,7 +1000,7 @@ void AlarmDialog::keyPressEvent(QKeyEvent *e)
bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &incidence) bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &incidence)
{ {
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.korganizer"))) { if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.korganizer"))) {
if (KToolInvocation::startServiceByDesktopName(QStringLiteral("org.kde.korganizer"), QString())) { if (!QDBusConnection::sessionBus().interface()->startService(QStringLiteral("org.kde.korganizer")).isValid()) {
KMessageBox::error(this, i18nc("@info", "Could not start KOrganizer so editing is not possible.")); KMessageBox::error(this, i18nc("@info", "Could not start KOrganizer so editing is not possible."));
return false; return false;
} }
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <KMessageBox> #include <KMessageBox>
#include <KSharedConfig> #include <KSharedConfig>
#include <KToolInvocation> #include <KToolInvocation>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QMenu> #include <QMenu>
AlarmDockWindow::AlarmDockWindow() AlarmDockWindow::AlarmDockWindow()
...@@ -154,7 +156,7 @@ void AlarmDockWindow::enableAutostart(bool enable) ...@@ -154,7 +156,7 @@ void AlarmDockWindow::enableAutostart(bool enable)
void AlarmDockWindow::activate(const QPoint &pos) void AlarmDockWindow::activate(const QPoint &pos)
{ {
Q_UNUSED(pos) Q_UNUSED(pos)
KToolInvocation::startServiceByDesktopName(QStringLiteral("org.kde.korganizer"), QString()); QDBusConnection::sessionBus().interface()->startService(QStringLiteral("org.kde.korganizer"));
} }
void AlarmDockWindow::slotQuit() void AlarmDockWindow::slotQuit()
......
...@@ -85,7 +85,7 @@ void KOEventViewerDialog::editIncidence() ...@@ -85,7 +85,7 @@ void KOEventViewerDialog::editIncidence()
// make sure korganizer is running or the part is shown // make sure korganizer is running or the part is shown
const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop")); const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop"));
QString error; QString error;
if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) { if (!QDBusConnection::sessionBus().interface()->startService(desktopFile).isValid()) {
OrgKdeKorganizerKorganizerInterface korganizerIface(QStringLiteral("org.kde.korganizer"), OrgKdeKorganizerKorganizerInterface korganizerIface(QStringLiteral("org.kde.korganizer"),
QStringLiteral("/Korganizer"), QStringLiteral("/Korganizer"),
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
...@@ -104,7 +104,7 @@ void KOEventViewerDialog::showIncidenceContext() ...@@ -104,7 +104,7 @@ void KOEventViewerDialog::showIncidenceContext()
// make sure korganizer is running or the part is shown // make sure korganizer is running or the part is shown
const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop")); const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop"));
QString error; QString error;
if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) { if (!QDBusConnection::sessionBus().interface()->startService(desktopFile).isValid()) {
OrgKdeKorganizerKorganizerInterface korganizerIface(QStringLiteral("org.kde.korganizer"), OrgKdeKorganizerKorganizerInterface korganizerIface(QStringLiteral("org.kde.korganizer"),
QStringLiteral("/Korganizer"), QStringLiteral("/Korganizer"),
QDBusConnection::sessionBus()); QDBusConnection::sessionBus());
......
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