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

Allow creating Followup reminders through a DBus call to the agent

The idea is for the client code to use this DBus method rather than writing to a shared
config file and triggering reload. This way it will be possible to get rid of the
intermediate libKF5FollowUpReminder library in kdepim-apps-libs.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision:
parent 64e2f082
......@@ -22,6 +22,8 @@
#include <FollowupReminder/FollowUpReminderUtil>
#include "followupreminderadaptor.h"
#include "followupreminderagentsettings.h"
#include <FollowupReminder/FollowUpReminderInfo>
#include <KMime/Message>
#include <AkonadiCore/ChangeRecorder>
......@@ -115,6 +117,19 @@ void FollowUpReminderAgent::reload()
void FollowUpReminderAgent::addReminder(const QString &messageId, Akonadi::Item::Id messageItemId, const QString &to, const QString &subject, const QDate &followupDate, Akonadi::Item::Id todoId)
auto info = new FollowUpReminder::FollowUpReminderInfo();
QString FollowUpReminderAgent::printDebugInfo() const
return mManager->printDebugInfo();
......@@ -36,6 +36,7 @@ public:
public Q_SLOTS:
void reload();
void addReminder(const QString &messageId, Akonadi::Item::Id messageItemId, const QString &to, const QString &subject, const QDate &followupDate, Akonadi::Item::Id todoId);
void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection) override;
......@@ -85,6 +85,15 @@ void FollowUpReminderManager::load(bool forceReloadConfig)
void FollowUpReminderManager::addReminder(FollowUpReminder::FollowUpReminderInfo *info)
if (info->isValid()) {
FollowUpReminderUtil::writeFollowupReminderInfo(FollowUpReminderUtil::defaultConfig(), info, true);
} else {
delete info;
void FollowUpReminderManager::slotReparseConfiguration()
......@@ -36,6 +36,7 @@ public:
void load(bool forceReloadConfig = false);
void addReminder(FollowUpReminder::FollowUpReminderInfo *reminder); // takes ownership
void checkFollowUp(const Akonadi::Item &item, const Akonadi::Collection &col);
Q_REQUIRED_RESULT QString printDebugInfo() const;
......@@ -11,5 +11,14 @@
<arg type="s" direction="out"/>
<method name="reload" />
<method name="addReminder">
<arg name="messageId" type="s" direction="in" />
<arg name="originalMessageItemId" type="x" direction="in" />
<arg name="to" type="s" direction="in" />
<arg name="subject" type="s" direction="in" />
<arg name="followupDate" type="(iii)" direction="in" />
<annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QDate" />
<arg name="todoId" type="x" direction="in" />
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