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)
bool AlarmDialog::openIncidenceEditorThroughKOrganizer(const Incidence::Ptr &incidence)
{
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."));
return false;
}
......
......@@ -18,6 +18,8 @@
#include <KMessageBox>
#include <KSharedConfig>
#include <KToolInvocation>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QMenu>
AlarmDockWindow::AlarmDockWindow()
......@@ -154,7 +156,7 @@ void AlarmDockWindow::enableAutostart(bool enable)
void AlarmDockWindow::activate(const QPoint &pos)
{
Q_UNUSED(pos)
KToolInvocation::startServiceByDesktopName(QStringLiteral("org.kde.korganizer"), QString());
QDBusConnection::sessionBus().interface()->startService(QStringLiteral("org.kde.korganizer"));
}
void AlarmDockWindow::slotQuit()
......
......@@ -85,7 +85,7 @@ void KOEventViewerDialog::editIncidence()
// make sure korganizer is running or the part is shown
const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop"));
QString error;
if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) {
if (!QDBusConnection::sessionBus().interface()->startService(desktopFile).isValid()) {
OrgKdeKorganizerKorganizerInterface korganizerIface(QStringLiteral("org.kde.korganizer"),
QStringLiteral("/Korganizer"),
QDBusConnection::sessionBus());
......@@ -104,7 +104,7 @@ void KOEventViewerDialog::showIncidenceContext()
// make sure korganizer is running or the part is shown
const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop"));
QString error;
if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) {
if (!QDBusConnection::sessionBus().interface()->startService(desktopFile).isValid()) {
OrgKdeKorganizerKorganizerInterface korganizerIface(QStringLiteral("org.kde.korganizer"),
QStringLiteral("/Korganizer"),
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