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>
bb10
David Faure 2014-04-07 14:02:29 +02:00 committed by The Qt Project
parent fbeb43135f
commit 6ea574d446
1 changed files with 1 additions and 2 deletions

View File

@ -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);