Commit 015cd875 authored by Laurent Montel's avatar Laurent Montel 😁

Fix multi instance

parent af86d2f4
......@@ -21,6 +21,7 @@ PRIVATE
KF5::ConfigGui
KF5::CoreAddons
Qt5::DBus
KF5::AkonadiCore
)
target_include_directories(KF5FollowupReminder INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/FollowupReminder/;${KDE_INSTALL_INCLUDEDIR_KF5}/followupreminder>")
......
......@@ -19,13 +19,18 @@
#include "followupreminderutil.h"
#include "followupreminderinfo.h"
#include <AkonadiCore/ServerManager>
#include <QDBusInterface>
#include "followupreminderagentsettings.h"
bool FollowUpReminder::FollowUpReminderUtil::followupReminderAgentWasRegistered()
{
QDBusInterface interface(QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_followupreminder_agent"), QStringLiteral("/FollowUpReminder"));
QString service = QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_followupreminder_agent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
}
QDBusInterface interface(service, QStringLiteral("/FollowUpReminder"));
return interface.isValid();
}
......@@ -36,7 +41,12 @@ bool FollowUpReminder::FollowUpReminderUtil::followupReminderAgentEnabled()
void FollowUpReminder::FollowUpReminderUtil::reload()
{
QDBusInterface interface(QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_followupreminder_agent"), QStringLiteral("/FollowUpReminder"));
QString service = QStringLiteral("org.freedesktop.Akonadi.Agent.akonadi_followupreminder_agent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
}
QDBusInterface interface(service, QStringLiteral("/FollowUpReminder"));
if (interface.isValid()) {
interface.call(QStringLiteral("reload"));
}
......
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