From 3ba3e12f9355bccec89feaa995b0297b2fb1f442 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 25 Jul 2007 14:01:48 +0000 Subject: [PATCH] - Fixed removing from finished list --- src/GUI.cpp | 12 +++++++----- src/bittorrent.cpp | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index c91c0b181..2e639ad23 100644 --- a/src/GUI.cpp +++ b/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); diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index d5091eebc..d0fac8226 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -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((hash.toStdString()))); if(!h.is_valid()){ qDebug("/!\\ Error: Invalid handle");