mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-21 16:55:46 +03: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:
parent
9fa48a375d
commit
31fe327763
52 changed files with 71 additions and 51 deletions
|
@ -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>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QAtomicInt>
|
||||
#include <QCoreApplication>
|
||||
#include <QPointer>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "applicationinstancemanager.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
#include "qtlocalpeer.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <Windows.h>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "signalhandler.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#include <algorithm>
|
||||
#include <csignal>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "upgrade.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QCoreApplication>
|
||||
#include <QMetaEnum>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtClassHelperMacros>
|
||||
|
||||
#include "interfaces/iapplication.h"
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "base/pathfwd.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <libtorrent/info_hash.hpp>
|
||||
#endif
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QMetaType>
|
||||
|
||||
#include "base/digest32.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
#include <QHostAddress>
|
||||
|
||||
class QString;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <boost/circular_buffer.hpp>
|
||||
#endif
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
|
||||
template<typename T>
|
||||
struct Sample
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtContainerFwd>
|
||||
#include <QtTypes>
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include <libtorrent/entry.hpp>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <libtorrent/socket.hpp>
|
||||
|
||||
#include <QtContainerFwd>
|
||||
#include <QtGlobal>
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include <libtorrent/sha1_hash.hpp>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QByteArray>
|
||||
#include <QHash>
|
||||
#include <QSharedData>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include <type_traits>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtProcessorDetection>
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtAssert>
|
||||
|
||||
// Interval is defined via [first;last]
|
||||
template <typename Index>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QMetaObject>
|
||||
|
||||
class QString;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
#include <QHash>
|
||||
#include <QNetworkProxy>
|
||||
#include <QObject>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtTypes>
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtContainerFwd>
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QObject>
|
||||
|
||||
#include "base/pathfwd.h"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <chrono>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtAssert>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFile>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtAssert>
|
||||
#include <QByteArray>
|
||||
|
||||
#ifndef ZLIB_CONST
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include <random>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "loglistview.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QFontMetrics>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "powermanagement.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
#include <IOKit/pwr_mgt/IOPMLib.h>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "programupdater.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <Windows.h>
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QHeaderView>
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "automatedrssdownloader.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QCursor>
|
||||
#include <QFileDialog>
|
||||
#include <QMenu>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "searchwidget.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#include <utility>
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QApplication>
|
||||
#include <QColor>
|
||||
#include <QHash>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QColor>
|
||||
#include <QHash>
|
||||
#include <QIcon>
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QColor>
|
||||
#include <QCoreApplication>
|
||||
#include <QHash>
|
||||
#include <QIcon>
|
||||
#include <QString>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "utils.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Objbase.h>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/algorithm.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
#include <QVector>
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <QTest>
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <tuple>
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
Loading…
Reference in a new issue