Commit 2413dce0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::chrono_literals

parent cd996bed
Pipeline #76759 passed with stage
in 15 minutes and 32 seconds
...@@ -18,13 +18,16 @@ ...@@ -18,13 +18,16 @@
#include <AkonadiCore/ServerManager> #include <AkonadiCore/ServerManager>
#include <QDir> #include <QDir>
#include <QStandardPaths> #include <QStandardPaths>
#include <chrono>
using namespace std::chrono_literals;
using namespace Akonadi::Search::PIM; using namespace Akonadi::Search::PIM;
Index::Index(QObject *parent) Index::Index(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
m_indexedItems = new IndexedItems(this); m_indexedItems = new IndexedItems(this);
m_commitTimer.setInterval(1000); m_commitTimer.setInterval(1s);
m_commitTimer.setSingleShot(true); m_commitTimer.setSingleShot(true);
connect(&m_commitTimer, &QTimer::timeout, this, &Index::commit); connect(&m_commitTimer, &QTimer::timeout, this, &Index::commit);
} }
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
#include <KConfigGroup> #include <KConfigGroup>
#include <KLocalizedString> #include <KLocalizedString>
#include <QTimer> #include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
JobFactory::~JobFactory() JobFactory::~JobFactory()
{ {
...@@ -41,7 +44,7 @@ Scheduler::Scheduler(Index &index, const KSharedConfigPtr &config, const QShared ...@@ -41,7 +44,7 @@ Scheduler::Scheduler(Index &index, const KSharedConfigPtr &config, const QShared
m_jobFactory = QSharedPointer<JobFactory>(new JobFactory); m_jobFactory = QSharedPointer<JobFactory>(new JobFactory);
} }
m_processTimer.setSingleShot(true); m_processTimer.setSingleShot(true);
m_processTimer.setInterval(100); m_processTimer.setInterval(100ms);
connect(&m_processTimer, &QTimer::timeout, this, &Scheduler::processNext); connect(&m_processTimer, &QTimer::timeout, this, &Scheduler::processNext);
KConfigGroup cfg = m_config->group("General"); KConfigGroup cfg = m_config->group("General");
......
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
#include <Item> #include <Item>
#include <ItemFetchJob> #include <ItemFetchJob>
#include <ItemFetchScope> #include <ItemFetchScope>
#include <chrono>
using namespace std::chrono_literals;
class App : public QApplication class App : public QApplication
{ {
Q_OBJECT Q_OBJECT
...@@ -61,7 +63,7 @@ App::App(int &argc, char **argv, int flags) ...@@ -61,7 +63,7 @@ App::App(int &argc, char **argv, int flags)
void App::main() void App::main()
{ {
m_commitTimer.setInterval(1000); m_commitTimer.setInterval(1s);
connect(&m_commitTimer, &QTimer::timeout, this, &App::slotCommitTimerElapsed); connect(&m_commitTimer, &QTimer::timeout, this, &App::slotCommitTimerElapsed);
m_commitTimer.start(); m_commitTimer.start();
......
Supports Markdown
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