Commit 84efdeae authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

std::chrono_literals

parent 0eef2db8
Pipeline #66887 failed with stage
in 25 minutes and 2 seconds
......@@ -23,6 +23,10 @@
#include <KLocalizedString>
#include <KMime/Message>
#include <KNotification>
#include <chrono>
using namespace std::chrono_literals;
#include <kcoreaddons_version.h>
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
......@@ -89,7 +93,7 @@ void MailDispatcherAgent::dispatch()
mAborting = false;
mSentAnything = false;
Q_EMIT status(AgentBase::Idle, i18n("Sending canceled."));
QTimer::singleShot(3000, this, &MailDispatcherAgent::emitStatusReady);
QTimer::singleShot(3s, this, &MailDispatcherAgent::emitStatusReady);
} else {
if (mSentAnything) {
// Finished sending messages in queue.
......@@ -110,7 +114,7 @@ void MailDispatcherAgent::dispatch()
// Empty queue.
Q_EMIT status(AgentBase::Idle, i18n("No items in queue."));
}
QTimer::singleShot(3000, this, &MailDispatcherAgent::emitStatusReady);
QTimer::singleShot(3s, this, &MailDispatcherAgent::emitStatusReady);
}
mErrorOccurred = false;
......
......@@ -8,6 +8,9 @@
#include "dummymigrator.h"
#include <QDebug>
#include <QTimer>
#include <chrono>
using namespace std::chrono_literals;
DummyMigrator::DummyMigrator(const QString &identifier)
: MigratorBase(QLatin1String("dummymigrator") + identifier, QString(), QString())
......@@ -22,7 +25,7 @@ QString DummyMigrator::displayName() const
void DummyMigrator::startWork()
{
qDebug();
QTimer::singleShot(10000, this, &DummyMigrator::onTimerElapsed);
QTimer::singleShot(10s, this, &DummyMigrator::onTimerElapsed);
}
void DummyMigrator::onTimerElapsed()
......
......@@ -11,6 +11,9 @@
#include "o2/o0globals.h"
#include "o2/o2.h"
#include "o2/o2requestor.h"
#include <chrono>
using namespace std::chrono_literals;
O2Requestor::O2Requestor(QNetworkAccessManager *manager, O2 *authenticator, QObject *parent)
: QObject(parent)
......@@ -77,10 +80,10 @@ void O2Requestor::onRefreshFinished(QNetworkReply::NetworkError error)
return;
}
if (QNetworkReply::NoError == error) {
QTimer::singleShot(100, this, &O2Requestor::retry);
QTimer::singleShot(100ms, this, &O2Requestor::retry);
} else {
error_ = error;
QTimer::singleShot(10, this, &O2Requestor::finish);
QTimer::singleShot(10ms, this, &O2Requestor::finish);
}
}
......@@ -95,7 +98,7 @@ void O2Requestor::onRequestFinished()
return;
}
if (error == QNetworkReply::NoError) {
QTimer::singleShot(10, this, &O2Requestor::finish);
QTimer::singleShot(10ms, this, &O2Requestor::finish);
}
}
......@@ -120,7 +123,7 @@ void O2Requestor::onRequestError(QNetworkReply::NetworkError error)
qCCritical(TOMBOYNOTESRESOURCE_LOG) << "O2Requestor::onRequestError: Invoking remote refresh failed";
}
error_ = error;
QTimer::singleShot(10, this, &O2Requestor::finish);
QTimer::singleShot(10ms, this, &O2Requestor::finish);
}
void O2Requestor::onUploadProgress(qint64 uploaded, qint64 total)
......
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