mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Add "Remove torrent and its files" option to share ratio limiting
This commit is contained in:
parent
19c70fd659
commit
07eb261991
7 changed files with 97 additions and 39 deletions
|
@ -885,10 +885,11 @@ void TorrentsController::deleteAction()
|
|||
checkParams({"hashes", "deleteFiles"});
|
||||
|
||||
const QStringList hashes {params()["hashes"].split('|')};
|
||||
const bool deleteFiles {parseBool(params()["deleteFiles"], false)};
|
||||
applyToTorrents(hashes, [deleteFiles](BitTorrent::TorrentHandle *const torrent)
|
||||
const DeleteOption deleteOption = parseBool(params()["deleteFiles"], false)
|
||||
? TorrentAndFiles : Torrent;
|
||||
applyToTorrents(hashes, [deleteOption](const BitTorrent::TorrentHandle *torrent)
|
||||
{
|
||||
BitTorrent::Session::instance()->deleteTorrent(torrent->hash(), deleteFiles);
|
||||
BitTorrent::Session::instance()->deleteTorrent(torrent->hash(), deleteOption);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue