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

Use std::chrono_literals

parent 785049dc
Pipeline #76647 passed with stage
in 15 minutes and 21 seconds
......@@ -25,6 +25,8 @@
#include "utils/kuniqueservice.h"
#include <stdio.h>
#include <chrono>
using namespace std::chrono_literals;
class TestObject : public QObject
{
......@@ -151,7 +153,7 @@ int main(int argc, char *argv[])
Qt::QueuedConnection,
Q_ARG(QStringList, args),
Q_ARG(QString, QDir::currentPath()));
QTimer::singleShot(400, &testObject, SLOT(firstCall()));
QTimer::singleShot(400ms, &testObject, SLOT(firstCall()));
qDebug() << "Running.";
a.exec();
......
......@@ -77,6 +77,8 @@
#include <vector>
#include <KSharedConfig>
#include <chrono>
using namespace std::chrono_literals;
using namespace Kleo;
using namespace Kleo::Commands;
......@@ -515,7 +517,7 @@ void MainWindow::closeEvent(QCloseEvent *e)
// wait for them to be finished:
setEnabled(false);
QEventLoop ev;
QTimer::singleShot(100, &ev, &QEventLoop::quit);
QTimer::singleShot(100ms, &ev, &QEventLoop::quit);
connect(&d->controller, &KeyListController::commandsExecuting, &ev, &QEventLoop::quit);
ev.exec();
if (d->controller.hasRunningCommands())
......
......@@ -23,6 +23,9 @@
#include <QObject>
#include <QSignalSpy>
#include <chrono>
using namespace std::chrono_literals;
// Replace this with a gpgme version check once GnuPG Bug #2092
// ( https://bugs.gnupg.org/gnupg/issue2092 ) is fixed.
#define GPGME_MULTITHREADED_KEYLIST_BROKEN
......@@ -107,7 +110,7 @@ public Q_SLOTS:
// Quit after 2500 jobs, that should be enough
mJobsStarted++;
if (mJobsStarted >= 2500) {
QTimer::singleShot(1000, &mEventLoop, &QEventLoop::quit);
QTimer::singleShot(1s, &mEventLoop, &QEventLoop::quit);
} else {
QTimer::singleShot(0, this, &VerifyTest::startAnotherJob);
}
......
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