Skip to content

Commit

Permalink
Move to separate headers
Browse files Browse the repository at this point in the history
Hopefully this can speed up compilation times.
https://doc.qt.io/qt-6/qtglobal.html#details

PR qbittorrent#19430.
  • Loading branch information
Chocobo1 authored Aug 11, 2023
1 parent 9fa48a3 commit 31fe327
Show file tree
Hide file tree
Showing 52 changed files with 71 additions and 51 deletions.
4 changes: 2 additions & 2 deletions CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ The headers should be ordered alphabetically within each group. \
If there are conditionals for the same header group, then put them at the bottom of the respective group. \
If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group.
One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
One exception is the header containing the library version (for example, QtVersionChecks), this particular header isn't constrained by the aforementioned order.
Example:
Expand All @@ -331,7 +331,7 @@ Example:
// exceptions, headers containing version number
#include <boost/version.hpp>
#include <libtorrent/version.hpp>
#include <QtGlobal>
#include <QtVersionChecks>
// C++ Standard Library headers
#include <cstdio>
Expand Down
2 changes: 1 addition & 1 deletion src/app/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#pragma once

#include <QtGlobal>
#include <QtSystemDetection>
#include <QAtomicInt>
#include <QCoreApplication>
#include <QPointer>
Expand Down
2 changes: 1 addition & 1 deletion src/app/applicationinstancemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "applicationinstancemanager.h"

#include <QtGlobal>
#include <QtSystemDetection>

#ifdef Q_OS_WIN
#include <windows.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* exception statement from your version.
*/

#include <QtGlobal>
#include <QtSystemDetection>

#include <chrono>
#include <cstdlib>
Expand Down
2 changes: 1 addition & 1 deletion src/app/qtlocalpeer/qtlocalpeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

#include "qtlocalpeer.h"

#include <QtGlobal>
#include <QtSystemDetection>

#if defined(Q_OS_WIN)
#include <Windows.h>
Expand Down
2 changes: 1 addition & 1 deletion src/app/signalhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "signalhandler.h"

#include <QtGlobal>
#include <QtSystemDetection>

#include <algorithm>
#include <csignal>
Expand Down
2 changes: 1 addition & 1 deletion src/app/upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "upgrade.h"

#include <QtGlobal>
#include <QtSystemDetection>
#include <QCoreApplication>
#include <QMetaEnum>

Expand Down
2 changes: 1 addition & 1 deletion src/base/applicationcomponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtClassHelperMacros>

#include "interfaces/iapplication.h"

Expand Down
1 change: 0 additions & 1 deletion src/base/bittorrent/abstractfilestorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#pragma once

#include <QtGlobal>
#include <QCoreApplication>

#include "base/pathfwd.h"
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/cachestatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtTypes>

namespace BitTorrent
{
Expand Down
1 change: 0 additions & 1 deletion src/base/bittorrent/infohash.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <libtorrent/info_hash.hpp>
#endif

#include <QtGlobal>
#include <QMetaType>

#include "base/digest32.h"
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/peeraddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtTypes>
#include <QHostAddress>

class QString;
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/sessionstatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtTypes>

namespace BitTorrent
{
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/speedmonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <boost/circular_buffer.hpp>
#endif

#include <QtGlobal>
#include <QtTypes>

template<typename T>
struct Sample
Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/torrent.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#pragma once

#include <QtGlobal>
#include <QtContainerFwd>
#include <QtTypes>
#include <QMetaType>
#include <QString>

Expand Down
2 changes: 1 addition & 1 deletion src/base/bittorrent/tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <libtorrent/entry.hpp>

#include <QtGlobal>
#include <QtTypes>
#include <QHash>
#include <QObject>
#include <QSet>
Expand Down
1 change: 0 additions & 1 deletion src/base/bittorrent/trackerentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <libtorrent/socket.hpp>

#include <QtContainerFwd>
#include <QtGlobal>
#include <QHash>
#include <QMap>
#include <QString>
Expand Down
1 change: 0 additions & 1 deletion src/base/digest32.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include <libtorrent/sha1_hash.hpp>

#include <QtGlobal>
#include <QByteArray>
#include <QHash>
#include <QSharedData>
Expand Down
2 changes: 1 addition & 1 deletion src/base/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <type_traits>

#include <QtGlobal>
#include <QtProcessorDetection>

#include <QString>

Expand Down
2 changes: 1 addition & 1 deletion src/base/indexrange.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtAssert>

// Interval is defined via [first;last]
template <typename Index>
Expand Down
2 changes: 1 addition & 1 deletion src/base/interfaces/iapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#pragma once

#include <QtGlobal>
#include <QtSystemDetection>
#include <QMetaObject>

class QString;
Expand Down
2 changes: 1 addition & 1 deletion src/base/net/downloadmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#pragma once

#include <QtGlobal>
#include <QtTypes>
#include <QHash>
#include <QNetworkProxy>
#include <QObject>
Expand Down
2 changes: 1 addition & 1 deletion src/base/net/geoipdatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtTypes>
#include <QCoreApplication>
#include <QDateTime>
#include <QHash>
Expand Down
3 changes: 2 additions & 1 deletion src/base/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@

#include <filesystem>

#include <QtGlobal>
#include <QMetaType>
#include <QString>

#include "pathfwd.h"

#include "base/interfaces/istringable.h"

class QStringView;

class Path final : public IStringable
{
public:
Expand Down
2 changes: 1 addition & 1 deletion src/base/preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#pragma once

#include <QtContainerFwd>
#include <QtGlobal>
#include <QtSystemDetection>
#include <QObject>

#include "base/pathfwd.h"
Expand Down
2 changes: 1 addition & 1 deletion src/base/torrentfileswatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include <chrono>

#include <QtGlobal>
#include <QtAssert>
#include <QDir>
#include <QDirIterator>
#include <QFile>
Expand Down
2 changes: 1 addition & 1 deletion src/base/utils/compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#pragma once

#include <Qt>
#include <QtGlobal>
#include <QtSystemDetection>

#if !defined(Q_OS_WIN) && (!defined(Q_OS_UNIX) || defined(Q_OS_MACOS) || defined(QT_FEATURE_icu))
#define QBT_USE_QCOLLATOR
Expand Down
2 changes: 1 addition & 1 deletion src/base/utils/gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include <vector>

#include <QtGlobal>
#include <QtAssert>
#include <QByteArray>

#ifndef ZLIB_CONST
Expand Down
2 changes: 1 addition & 1 deletion src/base/utils/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#pragma once

#include <QtGlobal>
#include <QtSystemDetection>

#ifdef Q_OS_WIN
#include <Windows.h>
Expand Down
2 changes: 1 addition & 1 deletion src/base/utils/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <random>

#include <QtGlobal>
#include <QtSystemDetection>

#ifdef Q_OS_WIN
#include <Windows.h>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/log/loglistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "loglistview.h"

#include <QtGlobal>
#include <QtSystemDetection>
#include <QApplication>
#include <QClipboard>
#include <QFontMetrics>
Expand Down
3 changes: 1 addition & 2 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "mainwindow.h"

#include <QtGlobal>
#include <QtSystemDetection>

#include <algorithm>
#include <chrono>
Expand Down Expand Up @@ -59,7 +59,6 @@
#include <QShortcut>
#include <QSplitter>
#include <QStatusBar>
#include <QtGlobal>
#include <QTimer>

#include "base/bittorrent/session.h"
Expand Down
2 changes: 1 addition & 1 deletion src/gui/powermanagement/powermanagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "powermanagement.h"

#include <QtGlobal>
#include <QtSystemDetection>

#ifdef Q_OS_MACOS
#include <IOKit/pwr_mgt/IOPMLib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/programupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "programupdater.h"

#include <QtGlobal>
#include <QtSystemDetection>

#if defined(Q_OS_WIN)
#include <Windows.h>
Expand Down
1 change: 0 additions & 1 deletion src/gui/properties/peerlistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#include <algorithm>

#include <QtGlobal>
#include <QApplication>
#include <QClipboard>
#include <QHeaderView>
Expand Down
1 change: 0 additions & 1 deletion src/gui/rss/automatedrssdownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "automatedrssdownloader.h"

#include <QtGlobal>
#include <QCursor>
#include <QFileDialog>
#include <QMenu>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/search/searchwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "searchwidget.h"

#include <QtGlobal>
#include <QtSystemDetection>

#include <utility>

Expand Down
1 change: 0 additions & 1 deletion src/gui/uithemecommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#pragma once

#include <QtGlobal>
#include <QApplication>
#include <QColor>
#include <QHash>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/uithememanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#pragma once

#include <QtGlobal>
#include <QtSystemDetection>
#include <QColor>
#include <QHash>
#include <QIcon>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/uithemesource.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#include <memory>

#include <QtGlobal>
#include <QColor>
#include <QCoreApplication>
#include <QHash>
#include <QIcon>
#include <QString>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "utils.h"

#include <QtGlobal>
#include <QtSystemDetection>

#ifdef Q_OS_WIN
#include <Objbase.h>
Expand Down
1 change: 1 addition & 0 deletions test/testalgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <unordered_map>
#include <unordered_set>

#include <QObject>
#include <QTest>

#include "base/algorithm.h"
Expand Down
Loading

0 comments on commit 31fe327

Please sign in to comment.