diff options
author | David Faure <david.faure@kdab.com> | 2014-04-07 14:02:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 05:16:58 +0200 |
commit | 6ea574d4461199e036fb9cd05b1bbdb0f93c390c (patch) | |
tree | 1290c4f62c95f652524671ae9a353d12b3cbfed2 /src | |
parent | fbeb43135feadbdfcd48b6717b5cb4017325cd1d (diff) |
QNetworkReplyHttpImpl: fix misuse of QDateTime::addSecs()
QDateTime::addSecs() is a const function and returns a new QDateTime with
the given seconds added, thus the current statement had no effect.
Found by applying Q_REQUIRED_RESULT in dev branch.
Change-Id: Id712334f91e0adb40bafc23470bf46479334c81a
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkreplyhttpimpl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index de4c8d0964..f043307c10 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -560,8 +560,7 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h if (!expirationDate.isValid()) { if (lastModified.isValid()) { int diff = currentDateTime.secsTo(lastModified); - expirationDate = lastModified; - expirationDate.addSecs(diff / 10); + expirationDate = lastModified.addSecs(diff / 10); if (httpRequest.headerField("Warning").isEmpty()) { QDateTime dt; dt.setTime_t(current_age); |