QtNetwork: fix warnings when compiling with QT_NO_BEARERMANAGEMENT

Resolving d- and q-pointers in code branches where we don't use them is
wasteful and leads to compile warnings.

Change-Id: Ib5dadd247acfe48722121e0e95ffcac61e7a2e09
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Ulf Hermann 2015-06-11 17:28:16 +02:00 committed by Marc Mutz
parent fedb442db3
commit 8558289780
2 changed files with 2 additions and 3 deletions

View File

@ -447,7 +447,6 @@ static void ensureInitialized()
QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
: QObject(*new QNetworkAccessManagerPrivate, parent)
{
Q_D(QNetworkAccessManager);
ensureInitialized();
qRegisterMetaType<QNetworkReply::NetworkError>();
@ -467,6 +466,7 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
qRegisterMetaType<QSharedPointer<char> >();
#ifndef QT_NO_BEARERMANAGEMENT
Q_D(QNetworkAccessManager);
if (!d->networkSessionRequired) {
// if a session is required, we track online state through
// the QNetworkSession's signals

View File

@ -65,8 +65,6 @@ inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate()
void QNetworkReplyImplPrivate::_q_startOperation()
{
Q_Q(QNetworkReplyImpl);
// ensure this function is only being called once
if (state == Working || state == Finished) {
qDebug("QNetworkReplyImpl::_q_startOperation was called more than once");
@ -85,6 +83,7 @@ void QNetworkReplyImplPrivate::_q_startOperation()
}
#ifndef QT_NO_BEARERMANAGEMENT
Q_Q(QNetworkReplyImpl);
// Do not start background requests if they are not allowed by session policy
QSharedPointer<QNetworkSession> session(manager->d_func()->getNetworkSession());
QVariant isBackground = backend->request().attribute(QNetworkRequest::BackgroundRequestAttribute, QVariant::fromValue(false));