Split TorrentHandle interface and implementation

This commit is contained in:
Vladimir Golovnev (Glassez)
2020-04-12 18:08:19 +03:00
parent c25b3e623c
commit 1132b84548
19 changed files with 2765 additions and 2538 deletions

View File

@@ -37,7 +37,9 @@
#include <QTextStream>
#include <QToolTip>
#include "base/indexrange.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/bittorrent/torrentinfo.h"
#include "base/utils/misc.h"
namespace

View File

@@ -43,6 +43,7 @@
#include <QUrl>
#include "base/bittorrent/downloadpriority.h"
#include "base/bittorrent/infohash.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/preferences.h"

View File

@@ -38,6 +38,7 @@
#include <QUrl>
#include <QVBoxLayout>
#include "base/bittorrent/infohash.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/bittorrent/trackerentry.h"
@@ -223,7 +224,7 @@ void StatusFilterWidget::updateTorrentNumbers()
int nbStalledDownloading = 0;
int nbErrored = 0;
const QHash<BitTorrent::InfoHash, BitTorrent::TorrentHandle *> torrents = BitTorrent::Session::instance()->torrents();
const QVector<BitTorrent::TorrentHandle *> torrents = BitTorrent::Session::instance()->torrents();
for (const BitTorrent::TorrentHandle *torrent : torrents) {
if (torrent->isDownloading())
++nbDownloading;

View File

@@ -31,6 +31,7 @@
#include <QDateTime>
#include <QStringList>
#include "base/bittorrent/infohash.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/global.h"
#include "base/types.h"

View File

@@ -652,7 +652,7 @@ void TransferListWidget::copySelectedMagnetURIs() const
{
QStringList magnetUris;
for (BitTorrent::TorrentHandle *const torrent : asConst(getSelectedTorrents()))
magnetUris << torrent->toMagnetUri();
magnetUris << torrent->createMagnetURI();
qApp->clipboard()->setText(magnetUris.join('\n'));
}