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"