mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
- Fixed removing from finished list
This commit is contained in:
parent
2ab7f6f923
commit
3ba3e12f93
12
src/GUI.cpp
12
src/GUI.cpp
@ -332,7 +332,7 @@ void GUI::setInfoBar(QString info, QString color){
|
||||
}
|
||||
|
||||
void GUI::addFastResumeRejectedAlert(QString name){
|
||||
setInfoBar(tr("Fast resume data was rejected for torrent %1").arg(name));
|
||||
setInfoBar(tr("Fast resume data was rejected for torrent %1, checking again...").arg(name));
|
||||
}
|
||||
|
||||
void GUI::balloonClicked(){
|
||||
@ -612,7 +612,9 @@ void GUI::updateDlList(bool force){
|
||||
case torrent_status::finished:
|
||||
case torrent_status::seeding:
|
||||
qDebug("Warning: this shouldn't happen, no finished torrents in download tab, moving it");
|
||||
DLListAccess.unlock();
|
||||
finishedTorrent(h);
|
||||
DLListAccess.lock();
|
||||
continue;
|
||||
case torrent_status::checking_files:
|
||||
case torrent_status::queued_for_checking:
|
||||
@ -1044,8 +1046,8 @@ void GUI::on_actionDelete_Permanently_triggered(){
|
||||
fileName = DLListModel->data(DLListModel->index(sortedIndex.second.row(), NAME)).toString();
|
||||
fileHash = DLListModel->data(DLListModel->index(sortedIndex.second.row(), HASH)).toString();
|
||||
}else{
|
||||
fileName = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), NAME)).toString();
|
||||
fileHash = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), HASH)).toString();
|
||||
fileName = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), F_NAME)).toString();
|
||||
fileHash = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), F_HASH)).toString();
|
||||
}
|
||||
// Remove the torrent
|
||||
BTSession->deleteTorrent(fileHash, true);
|
||||
@ -1116,8 +1118,8 @@ void GUI::on_actionDelete_triggered(){
|
||||
fileName = DLListModel->data(DLListModel->index(sortedIndex.second.row(), NAME)).toString();
|
||||
fileHash = DLListModel->data(DLListModel->index(sortedIndex.second.row(), HASH)).toString();
|
||||
}else{
|
||||
fileName = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), NAME)).toString();
|
||||
fileHash = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), HASH)).toString();
|
||||
fileName = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), F_NAME)).toString();
|
||||
fileHash = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(sortedIndex.second.row(), F_HASH)).toString();
|
||||
}
|
||||
// Remove the torrent
|
||||
BTSession->deleteTorrent(fileHash, false);
|
||||
|
@ -142,6 +142,7 @@ bool bittorrent::isPaused(QString hash) const{
|
||||
// Delete a torrent from the session, given its hash
|
||||
// permanent = true means that the torrent will be removed from the hard-drive too
|
||||
void bittorrent::deleteTorrent(QString hash, bool permanent){
|
||||
qDebug("Deleting torrent with hash: %s", (const char*)hash.toUtf8());
|
||||
torrent_handle h = s->find_torrent(misc::fromString<sha1_hash>((hash.toStdString())));
|
||||
if(!h.is_valid()){
|
||||
qDebug("/!\\ Error: Invalid handle");
|
||||
|
Loading…
Reference in New Issue
Block a user