Verified Commit fe786bee authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Start KOrgac via DBus activation

Summary:
KOrgac is already autostarted on session start, but KOrganizer had
some additional code to start it. Instead of using needlesly complicated
code in KdepimDBusInterfaces, simply use D-Bus service activation.

Reviewers: #kde_pim, vkrause

Reviewed By: #kde_pim, vkrause

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D29495
parent 5cdcb313
......@@ -117,7 +117,6 @@ find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5IncidenceEditor ${LIBINCIDENCEEDITOR_LIB_VERSION_LIB} CONFIG REQUIRED)
......
......@@ -89,3 +89,9 @@ install(FILES
org.kde.korganizer.KOrgac.xml
DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
)
configure_file(org.kde.korgac.service.in org.kde.korgac.service)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/org.kde.korgac.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
)
[D-BUS Service]
Name=org.kde.korgac
Exec=${CMAKE_INSTALL_FULL_BINDIR}/korgac
......@@ -29,7 +29,6 @@ target_link_libraries(testalarmdlg
KF5::AkonadiMime
KF5::CalendarSupport
KF5::IncidenceEditor
KF5::KdepimDBusInterfaces
KF5::KIOCore
KF5::Mime
korganizer_core
......
......@@ -45,7 +45,6 @@ target_link_libraries(korganizer
KF5::KontactInterface
KF5::CalendarCore
KF5::LibkdepimAkonadi
KF5::KdepimDBusInterfaces
korganizerprivate
korganizer_interfaces
korganizer_core
......@@ -251,7 +250,6 @@ target_link_libraries(korganizerprivate
KF5::EventViews
KF5::IncidenceEditor
KF5::LibkdepimAkonadi
KF5::KdepimDBusInterfaces
korganizer_core
korganizer_interfaces
KF5::AkonadiCore
......
......@@ -40,8 +40,8 @@
#include "koviewmanager.h"
#include "kowindowlist.h"
#include "kocheckableproxymodel.h"
#include "korgacinterface.h"
#include <KAuthorized>
#include <KdepimDBusInterfaces/ReminderClient>
#include <CalendarSupport/CollectionSelection>
#include <CalendarSupport/EventArchiver>
......@@ -1132,10 +1132,13 @@ void ActionManager::updateConfig()
KOCore::self()->reloadPlugins();
/* Hide/Show the Reminder Daemon */
org::kde::korganizer::KOrgac korgacInterface{
QStringLiteral("org.kde.korgac"), QStringLiteral("/ac"), QDBusConnection::sessionBus()
};
if (!KOPrefs::instance()->mShowReminderDaemon) {
KPIM::ReminderClient::hideDaemon();
korgacInterface.hide();
} else {
KPIM::ReminderClient::showDaemon();
korgacInterface.show();
}
// Commented out because it crashes KOrganizer.
......
......@@ -29,12 +29,14 @@
#include "calendarview.h"
#include "korganizer.h"
#include "korganizer-version.h"
#include <KCalendarCore/CalFormat>
#include <KdepimDBusInterfaces/ReminderClient>
#include "korganizer_debug.h"
#include "korganizer_options.h"
#include <QCommandLineParser>
#include <QDBusConnectionInterface>
KOrganizerApp::KOrganizerApp(int &argc, char **argv[])
: KontactInterface::PimUniqueApplication(argc, argv)
......@@ -66,7 +68,7 @@ int KOrganizerApp::activate(const QStringList &args, const QString &workingDir)
korganizer_options(&parser);
parser.process(args);
KPIM::ReminderClient::startDaemon();
QDBusConnection::sessionBus().interface()->startService(QStringLiteral("org.kde.korgac"));
// No filenames given => all other args are meaningless, show main Window
if (parser.positionalArguments().isEmpty()) {
......
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