Merge pull request #11241 from thalieht/delfolder

Add "Remove torrent and its files" option to share ratio limiting
This commit is contained in:
Mike Tzou 2019-09-29 09:51:41 +08:00 committed by GitHub
commit 975b44d05f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 104 additions and 46 deletions

View file

@ -59,11 +59,20 @@ class BandwidthScheduler;
class Statistics;
class ResumeDataSavingManager;
// These values should remain unchanged when adding new items
// so as not to break the existing user settings.
enum MaxRatioAction
{
Pause,
Remove,
EnableSuperSeeding
Pause = 0,
Remove = 1,
DeleteFiles = 3,
EnableSuperSeeding = 2
};
enum DeleteOption
{
Torrent,
TorrentAndFiles
};
enum TorrentExportFolder
@ -400,7 +409,7 @@ namespace BitTorrent
bool isKnownTorrent(const InfoHash &hash) const;
bool addTorrent(const QString &source, const AddTorrentParams &params = AddTorrentParams());
bool addTorrent(const TorrentInfo &torrentInfo, const AddTorrentParams &params = AddTorrentParams());
bool deleteTorrent(const QString &hash, bool deleteLocalFiles = false);
bool deleteTorrent(const QString &hash, DeleteOption deleteOption = Torrent);
bool loadMetadata(const MagnetUri &magnetUri);
bool cancelLoadMetadata(const InfoHash &hash);
@ -492,7 +501,7 @@ namespace BitTorrent
{
QString name;
QString savePathToRemove;
bool requestedFileDeletion;
DeleteOption deleteOption;
};
explicit Session(QObject *parent = nullptr);