Skip to content

Commit

Permalink
Misc: Do not depend on transitive includes
Browse files Browse the repository at this point in the history
As a drive-by, remove superfluous includes from qnetworkmanagerservice.h
and obey the coding conventions for includes in a few more places.

Change-Id: I65b68c0cef7598d06a125e97637040392d4be9ff
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
Inkane committed Mar 17, 2022
1 parent 49b25ab commit 468e9c1
Show file tree
Hide file tree
Showing 28 changed files with 47 additions and 6 deletions.
1 change: 1 addition & 0 deletions qmake/generators/win32/msbuild_objectmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <qstringlist.h>
#include <qfileinfo.h>
#include <qregularexpression.h>
#include <qvarlengtharray.h>

QT_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions src/dbus/qdbusintegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <qtimer.h>
#include <qthread.h>
#include <private/qlocking_p.h>
#include <QtCore/qset.h>

#include "qdbusargument.h"
#include "qdbusconnection_p.h"
Expand Down
5 changes: 5 additions & 0 deletions src/dbus/qdbusservicewatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@
#ifndef QDBUSSERVICEWATCHER_H
#define QDBUSSERVICEWATCHER_H

#include <QtCore/QObject>
#include <QtCore/qcontainerfwd.h> // Q(String)List
#include <QtDBus/qtdbusglobal.h>

#if !defined(QT_NO_DBUS) && !defined(QT_NO_QOBJECT)

QT_BEGIN_NAMESPACE

class QString;
template<typename T>
class QBindable;

class QDBusConnection;

Expand Down
7 changes: 4 additions & 3 deletions src/gui/kernel/qplatformmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@
// source and binary incompatible with future versions of Qt.
//

#include <QtCore/qobject.h>
#include <QtGui/qtguiglobal.h>
#include <QtCore/qpointer.h>
#include <QtGui/QFont>
#include <QtGui/qfont.h>
#if QT_CONFIG(shortcut)
# include <QtGui/QKeySequence>
# include <QtGui/qkeysequence.h>
#endif
#include <QtGui/QIcon>
#include <QtGui/qicon.h>

QT_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions src/gui/rhi/qshader_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
//

#include <QtGui/qtguiglobal.h>
#include <QtCore/qhash.h>
#include <private/qshaderdescription_p.h>

QT_BEGIN_NAMESPACE
Expand Down
1 change: 1 addition & 0 deletions src/gui/util/qktxhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "qtexturefiledata_p.h"
#include <QtEndian>
#include <QSize>
#include <QMap>
#include <QtCore/qiodevice.h>

//#define KTX_DEBUG
Expand Down
1 change: 1 addition & 0 deletions src/network/socket/qlocalserver_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ QT_REQUIRE_CONFIG(localserver);

#if defined(QT_LOCALSOCKET_TCP)
# include <qtcpserver.h>
# include <QtCore/qmap.h>
#elif defined(Q_OS_WIN)
# include <qt_windows.h>
# include <qwineventnotifier.h>
Expand Down
1 change: 1 addition & 0 deletions src/opengl/qopenglframebufferobject_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
// We mean it.
//

#include <QtCore/qvarlengtharray.h>
#include <qopenglframebufferobject.h>
#include <private/qopenglcontext_p.h>
#include <private/qopenglextensions_p.h>
Expand Down
1 change: 1 addition & 0 deletions src/opengl/qopenglshaderprogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifndef QOPENGLSHADERPROGRAM_H
#define QOPENGLSHADERPROGRAM_H

#include <QtCore/qobject.h>
#include <QtOpenGL/qtopenglglobal.h>

#include <QtGui/qopengl.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <QObject>
#include <QString>
#include <QList>
#include <QHash>
#include <QThread>
#include <QtCore/private/qthread_p.h>
#include <qpa/qwindowsysteminterface.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
// We mean it.
//

#include <QtDBus/QDBusAbstractInterface>
#include <QtDBus/QDBusPendingCallWatcher>
#include <QtDBus/QDBusObjectPath>
#include <QtCore/qvariant.h>
#include <QtCore/qmap.h>
#include <QtDBus/qdbusabstractinterface.h>

#include <optional>

Expand All @@ -74,6 +74,8 @@ enum NMDeviceState {

QT_BEGIN_NAMESPACE

class QDBusObjectPath;

// This tiny class exists for the purpose of seeing if NetworkManager is available without
// initializing everything the derived/full class needs.
class QNetworkManagerInterfaceBase : public QDBusAbstractInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "qcomposeplatforminputcontext.h"

#include <QtCore/QCoreApplication>
#include <QtCore/qvarlengtharray.h>
#include <QtGui/QKeyEvent>
#include <QtGui/QGuiApplication>

Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/android/androidjniaccessibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <QtCore/QJniObject>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtCore/QObject>
#include <QtCore/qvarlengtharray.h>

static const char m_qtTag[] = "Qt A11Y";
static const char m_classErrorMsg[] = "Can't find class \"%s\"";
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/android/qandroidplatformtheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include <qpa/qplatformtheme.h>
#include <QtGui/qfont.h>
#include <QtGui/qpalette.h>
#include <QtCore/qhash.h>
#include <QtCore/qbytearray.h>

#include <QJsonObject>

Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/cocoa/qcocoaaccessibility.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "qcocoaaccessibility.h"
#include "qcocoaaccessibilityelement.h"
#include <QtGui/qaccessible.h>
#include <QtCore/qmap.h>
#include <private/qcore_mac_p.h>

QT_BEGIN_NAMESPACE
Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/cocoa/qcocoaglcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#define QCOCOAGLCONTEXT_H

#include <QtCore/QPointer>
#include <QtCore/QVarLengthArray>
#include <QtCore/private/qcore_mac_p.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtGui/qopenglcontext.h>
Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/ios/qiosclipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifndef QIOSCLIPBOARD_H
#define QIOSCLIPBOARD_H

#include <QtCore/qmap.h>
#include <qpa/qplatformclipboard.h>

#ifndef QT_NO_CLIPBOARD
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <QtGui/QGuiApplication>
#include <qpa/qwindowsysteminterface.h>

#include <QtCore/qhash.h>
#include <QtCore/qbytearray.h>
#include <QtCore/QDebug>
#include <QtCore/QMetaEnum>
#include <QtCore/QSocketNotifier>
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/qnx/qqnxnavigatorpps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "qqnxnavigatorpps.h"

#include <QDebug>
#include <QHash>
#include <QByteArray>
#include <private/qcore_unix_p.h>

#if defined(QQNXNAVIGATOR_DEBUG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
****************************************************************************/

#include "qvkkhrdisplayvulkaninstance.h"
#include <QVarLengthArray>

QT_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/windows/qwindowsopengltester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "qwindowscontext.h"

#include <QtCore/qvariant.h>
#include <QtCore/qmap.h>
#include <QtCore/qdebug.h>
#include <QtCore/qtextstream.h>
#include <QtCore/qcoreapplication.h>
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/platforms/windows/qwindowstheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

#include <QtCore/qsharedpointer.h>
#include <QtCore/qvariant.h>
#include <QtCore/qlist.h>
#include <QtCore/qsize.h>

QT_BEGIN_NAMESPACE

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/tls/openssl/qsslsocket_openssl_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

#include <QtCore/QJniEnvironment>
#include <QtCore/QJniObject>
#include <QtCore/QList>
#include <QtCore/QByteArray>

QT_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions src/plugins/tls/openssl/qtlsbackend_openssl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
#include <QtCore/qscopeguard.h>
#include <QtCore/qset.h>

#include "qopenssl_p.h"

Expand Down
1 change: 1 addition & 0 deletions src/plugins/tls/schannel/qtlskey_schannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

#include <QtCore/qscopeguard.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qvarlengtharray.h>

QT_BEGIN_NAMESPACE

Expand Down
1 change: 1 addition & 0 deletions src/printsupport/platform/macos/qcocoaprintdevice_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

#ifndef QT_NO_PRINTER

#include <QtCore/qhash.h>
#include <ApplicationServices/ApplicationServices.h>

#include <QtPrintSupport/qtprintsupportglobal.h>
Expand Down
3 changes: 3 additions & 0 deletions src/tools/androiddeployqt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
#include <QElapsedTimer>
#include <QRegularExpression>
#include <QSettings>
#include <QHash>
#include <QSet>
#include <QMap>

#include <depfile_shared.h>

Expand Down
2 changes: 2 additions & 0 deletions src/tools/macdeployqt/shared/shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <QProcess>
#include <QDir>
#include <QSet>
#include <QVariant>
#include <QVariantMap>
#include <QStack>
#include <QDirIterator>
#include <QLibraryInfo>
Expand Down

0 comments on commit 468e9c1

Please sign in to comment.