diff --git a/TODO b/TODO index 477b28390..a6dc9a313 100644 --- a/TODO +++ b/TODO @@ -55,8 +55,6 @@ - Recheck doc - Translations update (IN PROGRESS) - add qt4-qtconfig as package dependency -RC5 -- Make use of this: added option to delete files from disk as a torrent is removed (libtorrent) rc4->rc5 changelog: - BUGFIX: Now filtered don't appear on hard drive anymore (libtorrent >= r1659) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index b055ff7a5..0bacc0178 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -27,7 +27,6 @@ #include "bittorrent.h" #include "misc.h" #include "downloadThread.h" -#include "deleteThread.h" #include #include @@ -62,8 +61,6 @@ bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false downloader = new downloadThread(this); connect(downloader, SIGNAL(downloadFinished(QString, QString)), this, SLOT(processDownloadedFile(QString, QString))); connect(downloader, SIGNAL(downloadFailure(QString, QString)), this, SLOT(handleDownloadFailure(QString, QString))); - // File deleter (thread) - deleter = new deleteThread(this); qDebug("* BTSession constructed"); } @@ -72,7 +69,6 @@ bittorrent::~bittorrent() { // Disable directory scanning disableDirectoryScanning(); // Delete our objects - delete deleter; delete timerAlerts; delete ETARefresher; delete downloader; @@ -210,12 +206,13 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) { } QString savePath = h.save_path(); QString fileName = h.name(); - arborescence *files_arb = 0; - if(permanent){ - files_arb = new arborescence(h.get_torrent_info()); - } // Remove it from session - s->remove_torrent(h.get_torrent_handle()); + if(permanent) { + qDebug("Removing this on hard drive: %s", qPrintable(savePath+QDir::separator()+fileName)); + s->remove_torrent(h.get_torrent_handle(), session::delete_files); + } else { + s->remove_torrent(h.get_torrent_handle()); + } // Remove it from torrent backup directory QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); QStringList filters; @@ -247,12 +244,6 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) { std::cerr << "Error: Torrent " << hash.toStdString() << " is neither in finished or unfinished list\n"; } } - if(permanent && files_arb != 0) { - // Remove from Hard drive - qDebug("Removing this on hard drive: %s", qPrintable(savePath+QDir::separator()+fileName)); - // Deleting in a thread to avoid GUI freeze - deleter->deleteTorrent(savePath, files_arb); - } } // Return a list of hashes for the finished torrents diff --git a/src/bittorrent.h b/src/bittorrent.h index 383f3a238..817b7fcab 100644 --- a/src/bittorrent.h +++ b/src/bittorrent.h @@ -33,7 +33,6 @@ using namespace libtorrent; class downloadThread; -class deleteThread; class QTimer; class bittorrent : public QObject{ @@ -54,7 +53,6 @@ class bittorrent : public QObject{ QHash > ratioData; QTimer *ETARefresher; QHash > > trackersErrors; - deleteThread *deleter; QStringList waitingForPause; QStringList finishedTorrents; QStringList unfinishedTorrents;