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