Add support for exporting .torrent data to buffer

Related: https://github.com/qbittorrent/qBittorrent/pull/16886#discussion_r855882018
PR #16931.
This commit is contained in:
Chocobo1
2022-04-27 12:29:00 +08:00
committed by GitHub
parent 7432c4dbfe
commit 9351f66c26
3 changed files with 37 additions and 7 deletions

View File

@@ -229,7 +229,8 @@ namespace BitTorrent
void clearPeers() override;
QString createMagnetURI() const override;
nonstd::expected<void, QString> exportToFile(const Path &path) const;
nonstd::expected<QByteArray, QString> exportToBuffer() const override;
nonstd::expected<void, QString> exportToFile(const Path &path) const override;
bool needSaveResumeData() const;
@@ -283,6 +284,8 @@ namespace BitTorrent
void endReceivedMetadataHandling(const Path &savePath, const PathList &fileNames);
void reload();
nonstd::expected<lt::entry, QString> exportTorrent() const;
Session *const m_session;
lt::session *m_nativeSession;
lt::torrent_handle m_nativeHandle;