diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-06-21 14:27:48 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-07-06 06:28:13 +0000 |
commit | 9e49778380c056b1ce7f30dbd774c545bff030c5 (patch) | |
tree | 04238d1dc639cdf3c7438c5deaca4d8e5f854ad7 /src/network/kernel/qauthenticator.cpp | |
parent | 829e421ddcd5e8ff065eaece965f499d7d1d8b40 (diff) |
Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code
Move those to the equivalent {to,set,from}SecsSinceEpoch(), except for
the cases that did QDateTime::currentDateTime{,Utc}().toTime_t. Those
are best implemented with QDateTime::currentSecsSinceEpoch().
Change-Id: Ib57b52598e2f452985e9fffd145a366c92cfda20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/kernel/qauthenticator.cpp')
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index 959db6e9d9..469879c78b 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -1271,14 +1271,10 @@ static QByteArray qEncodeNtlmv2Response(const QAuthenticatorPrivate *ctx, if(timeArray.size()) { ds.writeRawData(timeArray.constData(), timeArray.size()); } else { - QDateTime currentTime(QDate::currentDate(), - QTime::currentTime(), Qt::UTC); - - // number of seconds between 1601 and epoc(1970) + // number of seconds between 1601 and the epoch (1970) // 369 years, 89 leap years // ((369 * 365) + 89) * 24 * 3600 = 11644473600 - - time = Q_UINT64_C(currentTime.toTime_t() + 11644473600); + time = QDateTime::currentSecsSinceEpoch() + 11644473600; // represented as 100 nano seconds time = Q_UINT64_C(time * 10000000); |