Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a393b99e authored by Laurent Montel's avatar Laurent Montel 😁

Use directly QDateTime::currentSecsSinceEpoch

parent 96f76322
......@@ -574,7 +574,7 @@ QByteArray Maildir::readEntryHeaders(const QString &key) const
static QString createUniqueFileName()
{
const qint64 time = QDateTime::currentMSecsSinceEpoch() / 1000;
const qint64 time = QDateTime::currentSecsSinceEpoch();
const int r = qrand() % 1000;
const QString identifier = QLatin1String("R") + QString::number(r);
......
......@@ -289,7 +289,7 @@ void O2::onTokenReplyFinished()
int expiresIn = tokens.take(O2_OAUTH2_EXPIRES_IN).toInt(&ok);
if (ok) {
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O2::onTokenReplyFinished: Token expires in" << expiresIn << "seconds";
setExpires(QDateTime::currentMSecsSinceEpoch() / 1000 + expiresIn);
setExpires(QDateTime::currentSecsSinceEpoch() + expiresIn);
}
setRefreshToken(tokens.take(O2_OAUTH2_REFRESH_TOKEN).toString());
setExtraTokens(tokens);
......@@ -394,7 +394,7 @@ void O2::onRefreshFinished()
QByteArray reply = refreshReply->readAll();
QVariantMap tokens = parseTokenResponse(reply);
setToken(tokens.value(O2_OAUTH2_ACCESS_TOKEN).toString());
setExpires(QDateTime::currentMSecsSinceEpoch() / 1000 + tokens.value(O2_OAUTH2_EXPIRES_IN).toInt());
setExpires(QDateTime::currentSecsSinceEpoch() + tokens.value(O2_OAUTH2_EXPIRES_IN).toInt());
setRefreshToken(tokens.value(O2_OAUTH2_REFRESH_TOKEN).toString());
timedReplies_.remove(refreshReply);
setLinked(true);
......
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