Add unified class to represent parsed torrent metadata

* Add unified class to represent parsed torrent metadata
* Unify startup logic of "Add new torrent dialog"

PR #19301.
This commit is contained in:
Vladimir Golovnev
2023-07-21 08:40:16 +03:00
committed by GitHub
parent d554f4d44a
commit f27f2c20e0
18 changed files with 498 additions and 439 deletions

View File

@@ -58,8 +58,8 @@ enum DeleteOption
namespace BitTorrent
{
class InfoHash;
class MagnetUri;
class Torrent;
class TorrentDescriptor;
class TorrentID;
class TorrentInfo;
struct CacheStatus;
@@ -441,10 +441,9 @@ namespace BitTorrent
virtual bool isKnownTorrent(const InfoHash &infoHash) const = 0;
virtual bool addTorrent(const QString &source, const AddTorrentParams &params = {}) = 0;
virtual bool addTorrent(const MagnetUri &magnetUri, const AddTorrentParams &params = {}) = 0;
virtual bool addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams &params = {}) = 0;
virtual bool addTorrent(const TorrentDescriptor &torrentDescr, const AddTorrentParams &params = {}) = 0;
virtual bool deleteTorrent(const TorrentID &id, DeleteOption deleteOption = DeleteOption::DeleteTorrent) = 0;
virtual bool downloadMetadata(const MagnetUri &magnetUri) = 0;
virtual bool downloadMetadata(const TorrentDescriptor &torrentDescr) = 0;
virtual bool cancelDownloadMetadata(const TorrentID &id) = 0;
virtual void recursiveTorrentDownload(const TorrentID &id) = 0;