From b6b74752a55a3f8313c862902e4ce237fb457a57 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 14 Jul 2008 22:15:25 +0000 Subject: [PATCH] - Queueing bug fix --- src/bittorrent.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 954aa78f5..55fdc18ff 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -612,8 +612,18 @@ void bittorrent::setUnfinishedTorrent(QString hash) { TorrentsStartData[hash] = h.total_payload_download(); TorrentsStartTime[hash] = QDateTime::currentDateTime(); } - // Add it to downloadQueue if(queueingEnabled) { + // Remove it from uploadQueue + if(uploadQueue->contains(hash)) { + uploadQueue->removeAll(hash); + queuedDownloads->removeAll(hash); + if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".prio")) + QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".prio"); + if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".queued")) + QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".queued"); + updateUploadQueue(); + } + // Add it to downloadQueue if(!downloadQueue->contains(hash)) { downloadQueue->append(hash); saveTorrentPriority(hash, downloadQueue->size()-1);