Commit 59ae7f6b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement mailmergeagent

parent ea421cb1
......@@ -5,6 +5,8 @@
*/
#include "mailmergeagent.h"
#include "mailmergeagent_debug.h"
#include "mailmergeagentsettings.h"
#include "mailmergemanager.h"
#include <AgentInstance>
#include <AgentManager>
......@@ -22,7 +24,7 @@
#include <QPointer>
//#define DEBUG_MailMergeAgent 1
//#define DEBUG_MAILMERGEAGENT 1
MailMergeAgent::MailMergeAgent(const QString &id)
: Akonadi::AgentBase(id)
......@@ -65,7 +67,7 @@ void MailMergeAgent::slotStartAgent()
{
mAgentInitialized = true;
if (isOnline()) {
// mManager->load();
mManager->load();
}
}
......@@ -75,32 +77,32 @@ void MailMergeAgent::doSetOnline(bool online)
if (online) {
reload();
} else {
// mManager->stopAll();
mManager->stopAll();
}
}
}
void MailMergeAgent::reload()
{
// qCDebug(MailMergeAgent_LOG) << " void MailMergeAgent::reload()";
// if (MailMergeAgentSettings::enabled()) {
// mManager->load(true);
// }
qCDebug(MAILMERGEAGENT_LOG) << " void MailMergeAgent::reload()";
if (MailMergeAgentSettings::enabled()) {
mManager->load(true);
}
}
void MailMergeAgent::setEnableAgent(bool enabled)
{
// if (MailMergeAgentSettings::enabled() == enabled) {
// return;
// }
// MailMergeAgentSettings::setEnabled(enabled);
// MailMergeAgentSettings::self()->save();
// if (enabled) {
// mManager->load();
// } else {
// mManager->stopAll();
// }
if (MailMergeAgentSettings::enabled() == enabled) {
return;
}
MailMergeAgentSettings::setEnabled(enabled);
MailMergeAgentSettings::self()->save();
if (enabled) {
mManager->load();
} else {
mManager->stopAll();
}
}
bool MailMergeAgent::enabledAgent() const
......
......@@ -20,3 +20,7 @@ QString MailMergeManager::printDebugInfo() const
// TODO
return {};
}
void MailMergeManager::load(bool state) {}
void MailMergeManager::stopAll() {}
......@@ -15,4 +15,6 @@ public:
explicit MailMergeManager(QObject *parent = nullptr);
~MailMergeManager() override;
Q_REQUIRED_RESULT QString printDebugInfo() const;
void load(bool state = false);
void stopAll();
};
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