summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-12-08 13:20:26 +0100
committerMontel Laurent <[email protected]>2017-12-08 13:20:26 +0100
commita393b99effa858599ce7421538c012898fae05e5 (patch)
tree82af4f4cb34149914dac12e1a561d99cb424f008
parent96f763223d0e280415942b36eaba9583f9e2e603 (diff)
Use directly QDateTime::currentSecsSinceEpoch
-rw-r--r--resources/maildir/libmaildir/maildir.cpp2
-rw-r--r--resources/tomboynotes/o2/o2.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/resources/maildir/libmaildir/maildir.cpp b/resources/maildir/libmaildir/maildir.cpp
index ba516e9..f8fffd2 100644
--- a/resources/maildir/libmaildir/maildir.cpp
+++ b/resources/maildir/libmaildir/maildir.cpp
@@ -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);
diff --git a/resources/tomboynotes/o2/o2.cpp b/resources/tomboynotes/o2/o2.cpp
index 397f080..eef7067 100644
--- a/resources/tomboynotes/o2/o2.cpp
+++ b/resources/tomboynotes/o2/o2.cpp
@@ -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);