Add ability to pause/resume entire BitTorrent session

PR #20757.
Closes #18993.
This commit is contained in:
Vladimir Golovnev
2024-05-03 09:02:50 +03:00
committed by GitHub
parent 05416458db
commit 8ef7d3ec9a
16 changed files with 189 additions and 114 deletions

View File

@@ -407,9 +407,15 @@ namespace BitTorrent
void setResumeDataStorageType(ResumeDataStorageType type) override;
bool isMergeTrackersEnabled() const override;
void setMergeTrackersEnabled(bool enabled) override;
bool isStartPaused() const override;
void setStartPaused(bool value) override;
bool isRestored() const override;
bool isPaused() const override;
void pause() override;
void resume() override;
Torrent *getTorrent(const TorrentID &id) const override;
Torrent *findTorrent(const InfoHash &infoHash) const override;
QVector<Torrent *> torrents() const override;
@@ -722,8 +728,10 @@ namespace BitTorrent
CachedSettingValue<int> m_I2POutboundQuantity;
CachedSettingValue<int> m_I2PInboundLength;
CachedSettingValue<int> m_I2POutboundLength;
SettingValue<bool> m_startPaused;
bool m_isRestored = false;
bool m_isPaused = isStartPaused();
// Order is important. This needs to be declared after its CachedSettingsValue
// counterpart, because it uses it for initialization in the constructor