mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -07:00
- Fixed deletion message when deleting from finished list
- Added some more asserts (let's kill all those bugs time)
This commit is contained in:
parent
7f89b30190
commit
57376ae875
1 changed files with 10 additions and 3 deletions
11
src/GUI.cpp
11
src/GUI.cpp
|
@ -1036,12 +1036,15 @@ void GUI::on_actionDelete_Permanently_triggered(){
|
|||
foreach(fileHash, hashesToDelete){
|
||||
// Get the file name & hash
|
||||
QString fileName;
|
||||
int row = getRowFromHash(fileHash);
|
||||
int row = -1;
|
||||
if(inDownloadList){
|
||||
row = getRowFromHash(fileHash);
|
||||
fileName = DLListModel->data(DLListModel->index(row, NAME)).toString();
|
||||
}else{
|
||||
row = finishedTorrentTab->getRowFromHash(fileHash);
|
||||
fileName = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(row, F_NAME)).toString();
|
||||
}
|
||||
Q_ASSERT(row != -1);
|
||||
// Remove the torrent
|
||||
BTSession->deleteTorrent(fileHash, true);
|
||||
// Delete item from download list
|
||||
|
@ -1104,12 +1107,15 @@ void GUI::on_actionDelete_triggered(){
|
|||
foreach(fileHash, hashesToDelete){
|
||||
// Get the file name & hash
|
||||
QString fileName;
|
||||
int row = getRowFromHash(fileHash);
|
||||
int row = -1;
|
||||
if(inDownloadList){
|
||||
row = getRowFromHash(fileHash);
|
||||
fileName = DLListModel->data(DLListModel->index(row, NAME)).toString();
|
||||
}else{
|
||||
row = finishedTorrentTab->getRowFromHash(fileHash);
|
||||
fileName = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(row, F_NAME)).toString();
|
||||
}
|
||||
Q_ASSERT(row != -1);
|
||||
// Remove the torrent
|
||||
BTSession->deleteTorrent(fileHash, false);
|
||||
// Delete item from download list
|
||||
|
@ -1239,6 +1245,7 @@ void GUI::showProperties(const QModelIndex &index){
|
|||
|
||||
void GUI::updateFileSize(QString hash){
|
||||
int row = getRowFromHash(hash);
|
||||
Q_ASSERT(row != -1);
|
||||
DLListModel->setData(DLListModel->index(row, SIZE), QVariant((qlonglong)BTSession->torrentEffectiveSize(hash)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue