Browse Source

Refactor code

Remove forward declarations of Qt types.
Fix header include order.
adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
defba23d61
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 16
      src/base/bittorrent/session.cpp
  2. 17
      src/base/bittorrent/session.h
  3. 8
      src/base/bittorrent/torrentinfo.cpp
  4. 10
      src/base/bittorrent/torrentinfo.h
  5. 3
      src/gui/properties/peersadditiondlg.h

16
src/base/bittorrent/session.cpp

@ -49,9 +49,6 @@
#include <QUuid> #include <QUuid>
#include <libtorrent/alert_types.hpp> #include <libtorrent/alert_types.hpp>
#if LIBTORRENT_VERSION_NUM >= 10100
#include <libtorrent/bdecode.hpp>
#endif
#include <libtorrent/bencode.hpp> #include <libtorrent/bencode.hpp>
#include <libtorrent/disk_io_thread.hpp> #include <libtorrent/disk_io_thread.hpp>
#include <libtorrent/error_code.hpp> #include <libtorrent/error_code.hpp>
@ -60,17 +57,18 @@
#include <libtorrent/extensions/smart_ban.hpp> #include <libtorrent/extensions/smart_ban.hpp>
#include <libtorrent/identify_client.hpp> #include <libtorrent/identify_client.hpp>
#include <libtorrent/ip_filter.hpp> #include <libtorrent/ip_filter.hpp>
#if LIBTORRENT_VERSION_NUM < 10100
#include <libtorrent/lazy_entry.hpp>
#endif
#include <libtorrent/magnet_uri.hpp> #include <libtorrent/magnet_uri.hpp>
#include <libtorrent/session.hpp> #include <libtorrent/session.hpp>
#if LIBTORRENT_VERSION_NUM >= 10100
#include <libtorrent/session_stats.hpp>
#endif
#include <libtorrent/session_status.hpp> #include <libtorrent/session_status.hpp>
#include <libtorrent/torrent_info.hpp> #include <libtorrent/torrent_info.hpp>
#if LIBTORRENT_VERSION_NUM < 10100
#include <libtorrent/lazy_entry.hpp>
#else
#include <libtorrent/bdecode.hpp>
#include <libtorrent/session_stats.hpp>
#endif
#include "base/algorithm.h" #include "base/algorithm.h"
#include "base/logger.h" #include "base/logger.h"
#include "base/net/downloadhandler.h" #include "base/net/downloadhandler.h"

17
src/base/bittorrent/session.h

@ -30,18 +30,14 @@
#ifndef BITTORRENT_SESSION_H #ifndef BITTORRENT_SESSION_H
#define BITTORRENT_SESSION_H #define BITTORRENT_SESSION_H
#include <vector>
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
#if LIBTORRENT_VERSION_NUM >= 10100 #include <vector>
#include <QElapsedTimer>
#endif
#include <QFile> #include <QFile>
#include <QHash> #include <QHash>
#include <QList>
#include <QMap> #include <QMap>
#if LIBTORRENT_VERSION_NUM < 10100
#include <QMutex>
#endif
#include <QNetworkConfigurationManager> #include <QNetworkConfigurationManager>
#include <QPointer> #include <QPointer>
#include <QSet> #include <QSet>
@ -49,6 +45,12 @@
#include <QVector> #include <QVector>
#include <QWaitCondition> #include <QWaitCondition>
#if LIBTORRENT_VERSION_NUM < 10100
#include <QMutex>
#else
#include <QElapsedTimer>
#endif
#include "base/settingvalue.h" #include "base/settingvalue.h"
#include "base/tristatebool.h" #include "base/tristatebool.h"
#include "base/types.h" #include "base/types.h"
@ -111,7 +113,6 @@ class QTimer;
class QStringList; class QStringList;
class QString; class QString;
class QUrl; class QUrl;
template<typename T> class QList;
class FilterParserThread; class FilterParserThread;
class BandwidthScheduler; class BandwidthScheduler;

8
src/base/bittorrent/torrentinfo.cpp

@ -26,20 +26,20 @@
* exception statement from your version. * exception statement from your version.
*/ */
#include "torrentinfo.h"
#include <libtorrent/error_code.hpp>
#include <QDebug> #include <QDebug>
#include <QString> #include <QString>
#include <QList>
#include <QUrl> #include <QUrl>
#include <QDateTime> #include <QDateTime>
#include <libtorrent/error_code.hpp>
#include "base/utils/misc.h" #include "base/utils/misc.h"
#include "base/utils/fs.h" #include "base/utils/fs.h"
#include "base/utils/string.h" #include "base/utils/string.h"
#include "infohash.h" #include "infohash.h"
#include "trackerentry.h" #include "trackerentry.h"
#include "torrentinfo.h"
namespace libt = libtorrent; namespace libt = libtorrent;
using namespace BitTorrent; using namespace BitTorrent;

10
src/base/bittorrent/torrentinfo.h

@ -29,12 +29,14 @@
#ifndef BITTORRENT_TORRENTINFO_H #ifndef BITTORRENT_TORRENTINFO_H
#define BITTORRENT_TORRENTINFO_H #define BITTORRENT_TORRENTINFO_H
#include <QCoreApplication>
#include <QtGlobal>
#include <libtorrent/torrent_info.hpp> #include <libtorrent/torrent_info.hpp>
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
#include <QCoreApplication>
#include <QList>
#include <QtGlobal>
#include <QVector>
#include "base/indexrange.h" #include "base/indexrange.h"
class QString; class QString;
@ -42,8 +44,6 @@ class QUrl;
class QDateTime; class QDateTime;
class QStringList; class QStringList;
class QByteArray; class QByteArray;
template<typename T> class QList;
template<typename T> class QVector;
namespace BitTorrent namespace BitTorrent
{ {

3
src/gui/properties/peersadditiondlg.h

@ -30,11 +30,10 @@
#define PEERADDITION_H #define PEERADDITION_H
#include <QDialog> #include <QDialog>
#include <QList>
#include "base/bittorrent/peerinfo.h" #include "base/bittorrent/peerinfo.h"
template <typename T> class QList;
namespace Ui namespace Ui
{ {
class addPeersDialog; class addPeersDialog;

Loading…
Cancel
Save