Commit a9ef6de2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::chrono_literals

parent 07f8e7e3
Pipeline #66795 passed with stage
in 22 minutes and 56 seconds
......@@ -17,7 +17,9 @@
#include <QDBusConnection>
#include <QTimer>
#include <Session>
#include <chrono>
#include <kcoreaddons_version.h>
using namespace std::chrono_literals;
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
#endif
......@@ -56,13 +58,13 @@ ArchiveMailAgent::ArchiveMailAgent(const QString &id)
#ifdef DEBUG_ARCHIVEMAILAGENT
QTimer::singleShot(1000, mArchiveManager, &ArchiveMailManager::load);
#else
QTimer::singleShot(1000 * 60 * 5, mArchiveManager, &ArchiveMailManager::load);
QTimer::singleShot(5min, mArchiveManager, &ArchiveMailManager::load);
#endif
}
mTimer = new QTimer(this);
connect(mTimer, &QTimer::timeout, this, &ArchiveMailAgent::reload);
mTimer->start(24 * 60 * 60 * 1000);
mTimer->start(24h);
}
ArchiveMailAgent::~ArchiveMailAgent() = default;
......
......@@ -36,6 +36,9 @@
#include <KSharedConfig>
#include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
#include <kcoreaddons_version.h>
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
......@@ -170,7 +173,7 @@ void MailFilterAgent::initialCollectionFetchingDone(KJob *job)
}
Q_EMIT status(AgentBase::Idle, i18n("Ready"));
Q_EMIT percent(100);
QTimer::singleShot(2000, this, &MailFilterAgent::clearMessage);
QTimer::singleShot(2s, this, &MailFilterAgent::clearMessage);
}
void MailFilterAgent::clearMessage()
......
......@@ -17,9 +17,12 @@
#include <QEventLoop>
#include <QLabel>
#include <QStandardPaths>
#include <QTimer>
#include <QTemporaryDir>
#include <QTest>
#include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
QTEST_MAIN(KMComposerWinTest)
......@@ -218,7 +221,7 @@ void KMComposerWinTest::testChangeIdentity()
identCombo->setCurrentIdentity(ident);
// We need a small sleep so that identity change can take place
QEventLoop loop;
QTimer::singleShot(50, &loop, SLOT(quit()));
QTimer::singleShot(50ms, &loop, SLOT(quit()));
loop.exec();
QCoreApplication::processEvents(QEventLoop::AllEvents);
QCOMPARE(encryption->isVisible(), true);
......@@ -232,7 +235,7 @@ void KMComposerWinTest::testChangeIdentity()
identCombo->setCurrentIdentity(ident);
// We need a small sleep so that identity change can take place
QEventLoop loop;
QTimer::singleShot(50, &loop, SLOT(quit()));
QTimer::singleShot(50ms, &loop, SLOT(quit()));
loop.exec();
QCoreApplication::processEvents(QEventLoop::AllEvents);
QCOMPARE(encryption->isVisible(), false);
......
......@@ -33,6 +33,9 @@
#include <ktip.h>
#include <QLabel>
#include <chrono>
using namespace std::chrono_literals;
KMMainWin::KMMainWin(QWidget *)
: KXmlGuiWindow(nullptr)
......@@ -197,7 +200,7 @@ void KMMainWin::setupStatusBar()
mMessageLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
statusBar()->addWidget(mMessageLabel);
QTimer::singleShot(2000, PimCommon::BroadcastStatus::instance(), &PimCommon::BroadcastStatus::reset);
QTimer::singleShot(2s, PimCommon::BroadcastStatus::instance(), &PimCommon::BroadcastStatus::reset);
statusBar()->addPermanentWidget(mKMMainWidget->dkimWidgetInfo());
statusBar()->addPermanentWidget(mKMMainWidget->zoomLabelIndicator());
statusBar()->addPermanentWidget(mKMMainWidget->vacationScriptIndicator());
......
......@@ -27,6 +27,9 @@
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
Q_DECLARE_METATYPE(Qt::CheckState)
Q_DECLARE_METATYPE(QVector<qint64>)
......@@ -231,7 +234,7 @@ void IncompleteIndexDialog::slotCurrentlyIndexingCollectionChanged(qlonglong col
mProgressDialog->setValue(mProgressDialog->maximum() - mIndexingQueue.size());
if (mIndexingQueue.isEmpty()) {
QTimer::singleShot(1000, this, &IncompleteIndexDialog::accept);
QTimer::singleShot(1s, this, &IncompleteIndexDialog::accept);
}
}
}
......@@ -26,6 +26,9 @@
#include <AkonadiCore/CollectionStatistics>
#include <AkonadiCore/EntityMimeTypeFilterModel>
#include <AkonadiCore/EntityTreeModel>
#include <chrono>
using namespace std::chrono_literals;
using namespace KMail;
......@@ -102,7 +105,7 @@ void UnityServiceManager::initListOfCollection()
mCount = 0;
const QAbstractItemModel *model = kmkernel->collectionModel();
if (model->rowCount() == 0) {
QTimer::singleShot(1000, this, &UnityServiceManager::initListOfCollection);
QTimer::singleShot(1s, this, &UnityServiceManager::initListOfCollection);
return;
}
unreadMail(model);
......
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