Browse Source

Move to separate headers

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

PR #19430.
adaptive-webui-19844
Chocobo1 1 year ago committed by GitHub
parent
commit
31fe327763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CODING_GUIDELINES.md
  2. 2
      src/app/application.h
  3. 2
      src/app/applicationinstancemanager.cpp
  4. 2
      src/app/main.cpp
  5. 2
      src/app/qtlocalpeer/qtlocalpeer.cpp
  6. 2
      src/app/signalhandler.cpp
  7. 2
      src/app/upgrade.cpp
  8. 2
      src/base/applicationcomponent.h
  9. 1
      src/base/bittorrent/abstractfilestorage.h
  10. 2
      src/base/bittorrent/cachestatus.h
  11. 1
      src/base/bittorrent/infohash.h
  12. 2
      src/base/bittorrent/peeraddress.h
  13. 2
      src/base/bittorrent/sessionstatus.h
  14. 2
      src/base/bittorrent/speedmonitor.h
  15. 2
      src/base/bittorrent/torrent.h
  16. 2
      src/base/bittorrent/tracker.h
  17. 1
      src/base/bittorrent/trackerentry.h
  18. 1
      src/base/digest32.h
  19. 2
      src/base/global.h
  20. 2
      src/base/indexrange.h
  21. 2
      src/base/interfaces/iapplication.h
  22. 2
      src/base/net/downloadmanager.h
  23. 2
      src/base/net/geoipdatabase.h
  24. 3
      src/base/path.h
  25. 2
      src/base/preferences.h
  26. 2
      src/base/torrentfileswatcher.cpp
  27. 2
      src/base/utils/compare.h
  28. 2
      src/base/utils/gzip.cpp
  29. 2
      src/base/utils/misc.h
  30. 2
      src/base/utils/random.cpp
  31. 2
      src/gui/log/loglistview.cpp
  32. 3
      src/gui/mainwindow.cpp
  33. 2
      src/gui/powermanagement/powermanagement.cpp
  34. 2
      src/gui/programupdater.cpp
  35. 1
      src/gui/properties/peerlistwidget.cpp
  36. 1
      src/gui/rss/automatedrssdownloader.cpp
  37. 2
      src/gui/search/searchwidget.cpp
  38. 1
      src/gui/uithemecommon.h
  39. 2
      src/gui/uithememanager.h
  40. 2
      src/gui/uithemesource.h
  41. 2
      src/gui/utils.cpp
  42. 1
      test/testalgorithm.cpp
  43. 1
      test/testbittorrenttrackerentry.cpp
  44. 29
      test/testglobal.cpp
  45. 1
      test/testorderedset.cpp
  46. 3
      test/testpath.cpp
  47. 1
      test/testutilsbytearray.cpp
  48. 1
      test/testutilscompare.cpp
  49. 1
      test/testutilsgzip.cpp
  50. 3
      test/testutilsio.cpp
  51. 1
      test/testutilsstring.cpp
  52. 1
      test/testutilsversion.cpp

4
CODING_GUIDELINES.md

@ -318,7 +318,7 @@ The headers should be ordered alphabetically within each group. \ @@ -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: @@ -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>

2
src/app/application.h

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

2
src/app/applicationinstancemanager.cpp

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

2
src/app/main.cpp

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

2
src/app/qtlocalpeer/qtlocalpeer.cpp

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

2
src/app/signalhandler.cpp

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

2
src/app/upgrade.cpp

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

2
src/base/applicationcomponent.h

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

1
src/base/bittorrent/abstractfilestorage.h

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

2
src/base/bittorrent/cachestatus.h

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

1
src/base/bittorrent/infohash.h

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

2
src/base/bittorrent/peeraddress.h

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

2
src/base/bittorrent/sessionstatus.h

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

2
src/base/bittorrent/speedmonitor.h

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

2
src/base/bittorrent/torrent.h

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

2
src/base/bittorrent/tracker.h

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

1
src/base/bittorrent/trackerentry.h

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

1
src/base/digest32.h

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

2
src/base/global.h

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

2
src/base/indexrange.h

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

2
src/base/interfaces/iapplication.h

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

2
src/base/net/downloadmanager.h

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

2
src/base/net/geoipdatabase.h

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

3
src/base/path.h

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

2
src/base/preferences.h

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

2
src/base/torrentfileswatcher.cpp

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

2
src/base/utils/compare.h

@ -29,7 +29,7 @@ @@ -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

2
src/base/utils/gzip.cpp

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

2
src/base/utils/misc.h

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

2
src/base/utils/random.cpp

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

2
src/gui/log/loglistview.cpp

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

3
src/gui/mainwindow.cpp

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

2
src/gui/powermanagement/powermanagement.cpp

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

2
src/gui/programupdater.cpp

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

1
src/gui/properties/peerlistwidget.cpp

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

1
src/gui/rss/automatedrssdownloader.cpp

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

2
src/gui/search/searchwidget.cpp

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

1
src/gui/uithemecommon.h

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

2
src/gui/uithememanager.h

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

2
src/gui/uithemesource.h

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

2
src/gui/utils.cpp

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

1
test/testalgorithm.cpp

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

1
test/testbittorrenttrackerentry.cpp

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

29
test/testglobal.cpp

@ -26,7 +26,10 @@ @@ -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: @@ -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)

1
test/testorderedset.cpp

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

3
test/testpath.cpp

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

1
test/testutilsbytearray.cpp

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

1
test/testutilscompare.cpp

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

1
test/testutilsgzip.cpp

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

3
test/testutilsio.cpp

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

1
test/testutilsstring.cpp

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

1
test/testutilsversion.cpp

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

Loading…
Cancel
Save