Commit 49d3296d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::chrono_literals here

parent 61c99899
Pipeline #66341 passed with stage
in 24 minutes and 8 seconds
......@@ -26,6 +26,9 @@
#endif
#include "followupreminderagent_debug.h"
#include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
FollowUpReminderAgent::FollowUpReminderAgent(const QString &id)
: Akonadi::AgentBase(id)
......@@ -59,7 +62,7 @@ FollowUpReminderAgent::FollowUpReminderAgent(const QString &id)
mTimer = new QTimer(this);
connect(mTimer, &QTimer::timeout, this, &FollowUpReminderAgent::reload);
// Reload all each 24hours
mTimer->start(24 * 60 * 60 * 1000);
mTimer->start(24h);
}
FollowUpReminderAgent::~FollowUpReminderAgent() = default;
......
......@@ -25,6 +25,9 @@
#include <QPointer>
#include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
//#define DEBUG_MAILMERGEAGENT 1
......@@ -53,14 +56,14 @@ MailMergeAgent::MailMergeAgent(const QString &id)
#ifdef DEBUG_MailMergeAgent
QTimer::singleShot(1000, this, &MailMergeAgent::slotStartAgent);
#else
QTimer::singleShot(1000 * 60 * 4, this, &MailMergeAgent::slotStartAgent);
QTimer::singleShot(4min, this, &MailMergeAgent::slotStartAgent);
#endif
}
// For extra safety, check list every hour, in case we didn't properly get
// notified about the network going up or down.
auto reloadListTimer = new QTimer(this);
connect(reloadListTimer, &QTimer::timeout, this, &MailMergeAgent::reload);
reloadListTimer->start(1000 * 60 * 60); // 1 hour
reloadListTimer->start(1h); // 1 hour
}
MailMergeAgent::~MailMergeAgent() = default;
......
......@@ -31,6 +31,9 @@
#include <Kdelibs4ConfigMigrator>
#endif
#include <QPointer>
#include <chrono>
using namespace std::chrono_literals;
//#define DEBUG_SENDLATERAGENT 1
......@@ -63,14 +66,14 @@ SendLaterAgent::SendLaterAgent(const QString &id)
#ifdef DEBUG_SENDLATERAGENT
QTimer::singleShot(1000, this, &SendLaterAgent::slotStartAgent);
#else
QTimer::singleShot(1000 * 60 * 4, this, &SendLaterAgent::slotStartAgent);
QTimer::singleShot(4min, this, &SendLaterAgent::slotStartAgent);
#endif
}
// For extra safety, check list every hour, in case we didn't properly get
// notified about the network going up or down.
auto reloadListTimer = new QTimer(this);
connect(reloadListTimer, &QTimer::timeout, this, &SendLaterAgent::reload);
reloadListTimer->start(1000 * 60 * 60); // 1 hour
reloadListTimer->start(1h); // 1 hour
}
SendLaterAgent::~SendLaterAgent() = default;
......
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