mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-13 18:17:08 -07:00
FEATURE: Added option to skip torrent deletion confirmation (Ville Kiiskinen)
This commit is contained in:
parent
35a4e4aa1c
commit
8fd7b86f45
4 changed files with 37 additions and 18 deletions
|
@ -285,28 +285,29 @@ void TransferListWidget::pauseVisibleTorrents() {
|
|||
void TransferListWidget::deleteSelectedTorrents() {
|
||||
if(main_window->getCurrentTabWidget() != this) return;
|
||||
const QStringList& hashes = getSelectedTorrentsHashes();
|
||||
if(!hashes.empty()) {
|
||||
bool delete_local_files = false;
|
||||
if(DeletionConfirmationDlg::askForDeletionConfirmation(&delete_local_files)) {
|
||||
foreach(const QString &hash, hashes) {
|
||||
BTSession->deleteTorrent(hash, delete_local_files);
|
||||
}
|
||||
}
|
||||
if(hashes.empty()) return;
|
||||
bool delete_local_files = false;
|
||||
if(Preferences().confirmTorrentDeletion() &&
|
||||
!DeletionConfirmationDlg::askForDeletionConfirmation(&delete_local_files))
|
||||
return;
|
||||
foreach(const QString &hash, hashes) {
|
||||
BTSession->deleteTorrent(hash, delete_local_files);
|
||||
}
|
||||
}
|
||||
|
||||
void TransferListWidget::deleteVisibleTorrents() {
|
||||
if(nameFilterModel->rowCount() <= 0) return;
|
||||
bool delete_local_files = false;
|
||||
if(DeletionConfirmationDlg::askForDeletionConfirmation(&delete_local_files)) {
|
||||
QStringList hashes;
|
||||
for(int i=0; i<nameFilterModel->rowCount(); ++i) {
|
||||
const int row = mapToSource(nameFilterModel->index(i, 0)).row();
|
||||
hashes << getHashFromRow(row);
|
||||
}
|
||||
foreach(const QString &hash, hashes) {
|
||||
BTSession->deleteTorrent(hash, delete_local_files);
|
||||
}
|
||||
if(Preferences().confirmTorrentDeletion() &&
|
||||
!DeletionConfirmationDlg::askForDeletionConfirmation(&delete_local_files))
|
||||
return;
|
||||
QStringList hashes;
|
||||
for(int i=0; i<nameFilterModel->rowCount(); ++i) {
|
||||
const int row = mapToSource(nameFilterModel->index(i, 0)).row();
|
||||
hashes << getHashFromRow(row);
|
||||
}
|
||||
foreach(const QString &hash, hashes) {
|
||||
BTSession->deleteTorrent(hash, delete_local_files);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue