Skip to content

Commit

Permalink
Convert features.ftp to QT_[REQUIRE_]CONFIG
Browse files Browse the repository at this point in the history
QUrlInfo is used only by the FTP implementation, so it uses the same
conditionals.

Change-Id: Ia15abf44d2a538e90b792a31c65926cc9e16aecf
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
sbinner committed Sep 6, 2017
1 parent 68b8f2d commit 029e5cd
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 36 deletions.
14 changes: 10 additions & 4 deletions src/network/access/access.pri
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Qt network access module

HEADERS += \
access/qftp_p.h \
access/qhttpnetworkheader_p.h \
access/qhttpnetworkrequest_p.h \
access/qhttpnetworkreply_p.h \
Expand All @@ -18,7 +17,6 @@ HEADERS += \
access/qnetworkaccessdebugpipebackend_p.h \
access/qnetworkaccessfilebackend_p.h \
access/qnetworkaccesscachebackend_p.h \
access/qnetworkaccessftpbackend_p.h \
access/qnetworkcookie.h \
access/qnetworkcookie_p.h \
access/qnetworkcookiejar.h \
Expand All @@ -44,7 +42,6 @@ HEADERS += \
access/qhstspolicy.h

SOURCES += \
access/qftp.cpp \
access/qhttpnetworkheader.cpp \
access/qhttpnetworkrequest.cpp \
access/qhttpnetworkreply.cpp \
Expand All @@ -60,7 +57,6 @@ SOURCES += \
access/qnetworkaccessdebugpipebackend.cpp \
access/qnetworkaccessfilebackend.cpp \
access/qnetworkaccesscachebackend.cpp \
access/qnetworkaccessftpbackend.cpp \
access/qnetworkcookie.cpp \
access/qnetworkcookiejar.cpp \
access/qnetworkrequest.cpp \
Expand All @@ -78,6 +74,16 @@ SOURCES += \
access/qhsts.cpp \
access/qhstspolicy.cpp

qtConfig(ftp) {
HEADERS += \
access/qftp_p.h \
access/qnetworkaccessftpbackend_p.h

SOURCES += \
access/qftp.cpp \
access/qnetworkaccessftpbackend.cpp
}

mac: LIBS_PRIVATE += -framework Security

include($$PWD/../../3rdparty/zlib_dependency.pri)
Expand Down
4 changes: 0 additions & 4 deletions src/network/access/qftp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
#include "private/qftp_p.h"
#include "qabstractsocket.h"

#ifndef QT_NO_FTP

#include "qcoreapplication.h"
#include "qtcpsocket.h"
#include "qurlinfo_p.h"
Expand Down Expand Up @@ -2453,5 +2451,3 @@ QT_END_NAMESPACE
#include "qftp.moc"

#include "moc_qftp_p.cpp"

#endif // QT_NO_FTP
7 changes: 2 additions & 5 deletions src/network/access/qftp_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
#include <private/qurlinfo_p.h>
#include <QtCore/qobject.h>

QT_BEGIN_NAMESPACE

QT_REQUIRE_CONFIG(ftp);

#ifndef QT_NO_FTP
QT_BEGIN_NAMESPACE

class QFtpPrivate;

Expand Down Expand Up @@ -169,8 +168,6 @@ public Q_SLOTS:
Q_PRIVATE_SLOT(d_func(), void _q_piFtpReply(int, const QString&))
};

#endif // QT_NO_FTP

QT_END_NAMESPACE

#endif // QFTP_P_H
2 changes: 2 additions & 0 deletions src/network/access/qnetworkaccesscachebackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
#include "qnetworkaccesscachebackend_p.h"
#include "qabstractnetworkcache.h"
#include "qfileinfo.h"
#if QT_CONFIG(ftp)
#include "qurlinfo_p.h"
#endif
#include "qdir.h"
#include "qcoreapplication.h"

Expand Down
2 changes: 2 additions & 0 deletions src/network/access/qnetworkaccessfilebackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@

#include "qnetworkaccessfilebackend_p.h"
#include "qfileinfo.h"
#if QT_CONFIG(ftp)
#include "qurlinfo_p.h"
#endif
#include "qdir.h"
#include "private/qnoncontiguousbytedevice_p.h"

Expand Down
4 changes: 0 additions & 4 deletions src/network/access/qnetworkaccessftpbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
#include "private/qnoncontiguousbytedevice_p.h"
#include <QStringList>

#ifndef QT_NO_FTP

QT_BEGIN_NAMESPACE

enum {
Expand Down Expand Up @@ -382,5 +380,3 @@ void QNetworkAccessFtpBackend::ftpRawCommandReply(int code, const QString &text)
}

QT_END_NAMESPACE

#endif // QT_NO_FTP
4 changes: 1 addition & 3 deletions src/network/access/qnetworkaccessftpbackend_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

#include "QtCore/qpointer.h"

#ifndef QT_NO_FTP
QT_REQUIRE_CONFIG(ftp);

QT_BEGIN_NAMESPACE

Expand Down Expand Up @@ -122,6 +122,4 @@ class QNetworkAccessFtpBackendFactory: public QNetworkAccessBackendFactory

QT_END_NAMESPACE

#endif // QT_NO_FTP

#endif
8 changes: 5 additions & 3 deletions src/network/access/qnetworkaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
#include "QtNetwork/qnetworksession.h"
#include "QtNetwork/private/qsharednetworksession_p.h"

#if QT_CONFIG(ftp)
#include "qnetworkaccessftpbackend_p.h"
#endif
#include "qnetworkaccessfilebackend_p.h"
#include "qnetworkaccessdebugpipebackend_p.h"
#include "qnetworkaccesscachebackend_p.h"
Expand All @@ -76,9 +78,9 @@
QT_BEGIN_NAMESPACE

Q_GLOBAL_STATIC(QNetworkAccessFileBackendFactory, fileBackend)
#ifndef QT_NO_FTP
#if QT_CONFIG(ftp)
Q_GLOBAL_STATIC(QNetworkAccessFtpBackendFactory, ftpBackend)
#endif // QT_NO_FTP
#endif // QT_CONFIG(ftp)

#ifdef QT_BUILD_INTERNAL
Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend)
Expand Down Expand Up @@ -146,7 +148,7 @@ bool getProxyAuth(const QString& proxyHostname, const QString &scheme, QString&

static void ensureInitialized()
{
#ifndef QT_NO_FTP
#if QT_CONFIG(ftp)
(void) ftpBackend();
#endif

Expand Down
11 changes: 7 additions & 4 deletions src/network/kernel/kernel.pri
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ HEADERS += kernel/qtnetworkglobal.h \
kernel/qnetworkdatagram_p.h \
kernel/qnetworkinterface.h \
kernel/qnetworkinterface_p.h \
kernel/qnetworkproxy.h \
kernel/qurlinfo_p.h
kernel/qnetworkproxy.h

SOURCES += kernel/qauthenticator.cpp \
kernel/qdnslookup.cpp \
kernel/qhostaddress.cpp \
kernel/qhostinfo.cpp \
kernel/qnetworkdatagram.cpp \
kernel/qnetworkinterface.cpp \
kernel/qnetworkproxy.cpp \
kernel/qurlinfo.cpp
kernel/qnetworkproxy.cpp

qtConfig(ftp) {
HEADERS += kernel/qurlinfo_p.h
SOURCES += kernel/qurlinfo.cpp
}

unix {
!integrity: SOURCES += kernel/qdnslookup_unix.cpp
Expand Down
4 changes: 0 additions & 4 deletions src/network/kernel/qurlinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@

#include "qurlinfo_p.h"

#ifndef QT_NO_FTP

#include "qurl.h"
#include "qdir.h"
#include <limits.h>
Expand Down Expand Up @@ -727,5 +725,3 @@ bool QUrlInfo::isValid() const
}

QT_END_NAMESPACE

#endif // QT_NO_FTP
7 changes: 2 additions & 5 deletions src/network/kernel/qurlinfo_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
#include <QtCore/qstring.h>
#include <QtCore/qiodevice.h>

QT_BEGIN_NAMESPACE

QT_REQUIRE_CONFIG(ftp);

#ifndef QT_NO_FTP
QT_BEGIN_NAMESPACE

class QUrl;
class QUrlInfoPrivate;
Expand Down Expand Up @@ -129,8 +128,6 @@ class Q_NETWORK_EXPORT QUrlInfo
QUrlInfoPrivate *d;
};

#endif // QT_NO_FTP

QT_END_NAMESPACE

#endif // QURLINFO_H

0 comments on commit 029e5cd

Please sign in to comment.