1
mirror of https://github.com/qbittorrent/qBittorrent synced 2024-09-28 16:12:07 +02:00

Move to separate headers

Hopefully this can speed up compilation times.
https://doc.qt.io/qt-6/qtglobal.html#details

PR #19430.
This commit is contained in:
Chocobo1 2023-08-11 13:47:55 +08:00 committed by GitHub
parent 9fa48a375d
commit 31fe327763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 71 additions and 51 deletions

View File

@ -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:
@ -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>

View File

@ -30,7 +30,7 @@
#pragma once
#include <QtGlobal>
#include <QtSystemDetection>
#include <QAtomicInt>
#include <QCoreApplication>
#include <QPointer>

View File

@ -28,7 +28,7 @@
#include "applicationinstancemanager.h"
#include <QtGlobal>
#include <QtSystemDetection>
#ifdef Q_OS_WIN
#include <windows.h>

View File

@ -27,7 +27,7 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <QtSystemDetection>
#include <chrono>
#include <cstdlib>

View File

@ -68,7 +68,7 @@
#include "qtlocalpeer.h"
#include <QtGlobal>
#include <QtSystemDetection>
#if defined(Q_OS_WIN)
#include <Windows.h>

View File

@ -30,7 +30,7 @@
#include "signalhandler.h"
#include <QtGlobal>
#include <QtSystemDetection>
#include <algorithm>
#include <csignal>

View File

@ -28,7 +28,7 @@
#include "upgrade.h"
#include <QtGlobal>
#include <QtSystemDetection>
#include <QCoreApplication>
#include <QMetaEnum>

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtClassHelperMacros>
#include "interfaces/iapplication.h"

View File

@ -28,7 +28,6 @@
#pragma once
#include <QtGlobal>
#include <QCoreApplication>
#include "base/pathfwd.h"

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtTypes>
namespace BitTorrent
{

View File

@ -32,7 +32,6 @@
#include <libtorrent/info_hash.hpp>
#endif
#include <QtGlobal>
#include <QMetaType>
#include "base/digest32.h"

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtTypes>
#include <QHostAddress>
class QString;

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtTypes>
namespace BitTorrent
{

View File

@ -33,7 +33,7 @@
#include <boost/circular_buffer.hpp>
#endif
#include <QtGlobal>
#include <QtTypes>
template<typename T>
struct Sample

View File

@ -29,8 +29,8 @@
#pragma once
#include <QtGlobal>
#include <QtContainerFwd>
#include <QtTypes>
#include <QMetaType>
#include <QString>

View File

@ -34,7 +34,7 @@
#include <libtorrent/entry.hpp>
#include <QtGlobal>
#include <QtTypes>
#include <QHash>
#include <QObject>
#include <QSet>

View File

@ -31,7 +31,6 @@
#include <libtorrent/socket.hpp>
#include <QtContainerFwd>
#include <QtGlobal>
#include <QHash>
#include <QMap>
#include <QString>

View File

@ -30,7 +30,6 @@
#include <libtorrent/sha1_hash.hpp>
#include <QtGlobal>
#include <QByteArray>
#include <QHash>
#include <QSharedData>

View File

@ -30,7 +30,7 @@
#include <type_traits>
#include <QtGlobal>
#include <QtProcessorDetection>
#include <QString>

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtAssert>
// Interval is defined via [first;last]
template <typename Index>

View File

@ -30,7 +30,7 @@
#pragma once
#include <QtGlobal>
#include <QtSystemDetection>
#include <QMetaObject>
class QString;

View File

@ -29,7 +29,7 @@
#pragma once
#include <QtGlobal>
#include <QtTypes>
#include <QHash>
#include <QNetworkProxy>
#include <QObject>

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtTypes>
#include <QCoreApplication>
#include <QDateTime>
#include <QHash>

View File

@ -31,7 +31,6 @@
#include <filesystem>
#include <QtGlobal>
#include <QMetaType>
#include <QString>
@ -39,6 +38,8 @@
#include "base/interfaces/istringable.h"
class QStringView;
class Path final : public IStringable
{
public:

View File

@ -30,7 +30,7 @@
#pragma once
#include <QtContainerFwd>
#include <QtGlobal>
#include <QtSystemDetection>
#include <QObject>
#include "base/pathfwd.h"

View File

@ -31,7 +31,7 @@
#include <chrono>
#include <QtGlobal>
#include <QtAssert>
#include <QDir>
#include <QDirIterator>
#include <QFile>

View File

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

View File

@ -31,7 +31,7 @@
#include <vector>
#include <QtGlobal>
#include <QtAssert>
#include <QByteArray>
#ifndef ZLIB_CONST

View File

@ -28,7 +28,7 @@
#pragma once
#include <QtGlobal>
#include <QtSystemDetection>
#ifdef Q_OS_WIN
#include <Windows.h>

View File

@ -30,7 +30,7 @@
#include <random>
#include <QtGlobal>
#include <QtSystemDetection>
#ifdef Q_OS_WIN
#include <Windows.h>

View File

@ -29,7 +29,7 @@
#include "loglistview.h"
#include <QtGlobal>
#include <QtSystemDetection>
#include <QApplication>
#include <QClipboard>
#include <QFontMetrics>

View File

@ -29,7 +29,7 @@
#include "mainwindow.h"
#include <QtGlobal>
#include <QtSystemDetection>
#include <algorithm>
#include <chrono>
@ -59,7 +59,6 @@
#include <QShortcut>
#include <QSplitter>
#include <QStatusBar>
#include <QtGlobal>
#include <QTimer>
#include "base/bittorrent/session.h"

View File

@ -28,7 +28,7 @@
#include "powermanagement.h"
#include <QtGlobal>
#include <QtSystemDetection>
#ifdef Q_OS_MACOS
#include <IOKit/pwr_mgt/IOPMLib.h>

View File

@ -29,7 +29,7 @@
#include "programupdater.h"
#include <QtGlobal>
#include <QtSystemDetection>
#if defined(Q_OS_WIN)
#include <Windows.h>

View File

@ -31,7 +31,6 @@
#include <algorithm>
#include <QtGlobal>
#include <QApplication>
#include <QClipboard>
#include <QHeaderView>

View File

@ -29,7 +29,6 @@
#include "automatedrssdownloader.h"
#include <QtGlobal>
#include <QCursor>
#include <QFileDialog>
#include <QMenu>

View File

@ -30,7 +30,7 @@
#include "searchwidget.h"
#include <QtGlobal>
#include <QtSystemDetection>
#include <utility>

View File

@ -29,7 +29,6 @@
#pragma once
#include <QtGlobal>
#include <QApplication>
#include <QColor>
#include <QHash>

View File

@ -30,7 +30,7 @@
#pragma once
#include <QtGlobal>
#include <QtSystemDetection>
#include <QColor>
#include <QHash>
#include <QIcon>

View File

@ -32,8 +32,8 @@
#include <memory>
#include <QtGlobal>
#include <QColor>
#include <QCoreApplication>
#include <QHash>
#include <QIcon>
#include <QString>

View File

@ -28,7 +28,7 @@
#include "utils.h"
#include <QtGlobal>
#include <QtSystemDetection>
#ifdef Q_OS_WIN
#include <Objbase.h>

View File

@ -31,6 +31,7 @@
#include <unordered_map>
#include <unordered_set>
#include <QObject>
#include <QTest>
#include "base/algorithm.h"

View File

@ -28,6 +28,7 @@
#include <algorithm>
#include <QObject>
#include <QTest>
#include <QVector>

View File

@ -26,7 +26,10 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <type_traits>
#include <QList>
#include <QObject>
#include <QTest>
#include "base/global.h"
@ -40,13 +43,27 @@ public:
TestGlobal() = default;
private slots:
#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
void testStringLiteral() const
void testAsConst() const
{
QCOMPARE(u""_s, QStringLiteral(""));
QCOMPARE(u"abc"_s, QStringLiteral("abc"));
{
QList<int> list = {0, 1, 2};
static_assert(std::is_const_v<std::remove_reference_t<decltype(asConst(list))>>);
QCOMPARE(list, asConst(list));
QCOMPARE(list, asConst(QList<int>(list)));
}
{
const QList<int> list = {0, 1, 2};
static_assert(std::is_const_v<std::remove_reference_t<decltype(asConst(list))>>);
QCOMPARE(list, asConst(list));
QCOMPARE(list, asConst(QList<int>(list)));
// should not compile:
//asConst(std::move(list));
}
}
#endif
};
QTEST_APPLESS_MAIN(TestGlobal)

View File

@ -27,6 +27,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QSet>
#include <QTest>

View File

@ -26,7 +26,8 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <QtSystemDetection>
#include <QObject>
#include <QTest>
#include "base/global.h"

View File

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"

View File

@ -28,6 +28,7 @@
#include <tuple>
#include <QObject>
#include <QTest>
#include "base/global.h"

View File

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"

View File

@ -26,7 +26,8 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <QtSystemDetection>
#include <QObject>
#include <QTest>
#include "base/global.h"

View File

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"

View File

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"