mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- BUGFIX: Fixed deletion of subfolders when deleting torrents from hard drive
This commit is contained in:
parent
1519bca46d
commit
a5f6663e65
1
TODO
1
TODO
@ -62,4 +62,5 @@ rc5->rc6 changelog:
|
|||||||
- BUGFIX: configure doesn't require paths with a terminal "/" anymore
|
- BUGFIX: configure doesn't require paths with a terminal "/" anymore
|
||||||
- BUGFIX: Fixed minimize to tray feature
|
- BUGFIX: Fixed minimize to tray feature
|
||||||
- BUGFIX: Fixed folders progress calculation in torrent properties
|
- BUGFIX: Fixed folders progress calculation in torrent properties
|
||||||
|
- BUGFIX: Fixed deletion of subfolders when deleting torrents from hard drive
|
||||||
- I18N: Fixed swedish, French, Spanish translations
|
- I18N: Fixed swedish, French, Spanish translations
|
@ -27,6 +27,7 @@
|
|||||||
#include "bittorrent.h"
|
#include "bittorrent.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "downloadThread.h"
|
#include "downloadThread.h"
|
||||||
|
#include "deleteThread.h"
|
||||||
|
|
||||||
#include <libtorrent/extensions/metadata_transfer.hpp>
|
#include <libtorrent/extensions/metadata_transfer.hpp>
|
||||||
#include <libtorrent/extensions/ut_pex.hpp>
|
#include <libtorrent/extensions/ut_pex.hpp>
|
||||||
@ -61,6 +62,8 @@ bittorrent::bittorrent() : timerScan(0), DHTEnabled(false), preAllocateAll(false
|
|||||||
downloader = new downloadThread(this);
|
downloader = new downloadThread(this);
|
||||||
connect(downloader, SIGNAL(downloadFinished(QString, QString)), this, SLOT(processDownloadedFile(QString, QString)));
|
connect(downloader, SIGNAL(downloadFinished(QString, QString)), this, SLOT(processDownloadedFile(QString, QString)));
|
||||||
connect(downloader, SIGNAL(downloadFailure(QString, QString)), this, SLOT(handleDownloadFailure(QString, QString)));
|
connect(downloader, SIGNAL(downloadFailure(QString, QString)), this, SLOT(handleDownloadFailure(QString, QString)));
|
||||||
|
// File deleter (thread)
|
||||||
|
deleter = new deleteThread(this);
|
||||||
qDebug("* BTSession constructed");
|
qDebug("* BTSession constructed");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +72,7 @@ bittorrent::~bittorrent() {
|
|||||||
// Disable directory scanning
|
// Disable directory scanning
|
||||||
disableDirectoryScanning();
|
disableDirectoryScanning();
|
||||||
// Delete our objects
|
// Delete our objects
|
||||||
|
delete deleter;
|
||||||
delete timerAlerts;
|
delete timerAlerts;
|
||||||
delete ETARefresher;
|
delete ETARefresher;
|
||||||
delete downloader;
|
delete downloader;
|
||||||
@ -206,13 +210,12 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
|
|||||||
}
|
}
|
||||||
QString savePath = h.save_path();
|
QString savePath = h.save_path();
|
||||||
QString fileName = h.name();
|
QString fileName = h.name();
|
||||||
// Remove it from session
|
arborescence *files_arb = 0;
|
||||||
if(permanent) {
|
if(permanent){
|
||||||
qDebug("Removing this on hard drive: %s", qPrintable(savePath+QDir::separator()+fileName));
|
files_arb = new arborescence(h.get_torrent_info());
|
||||||
s->remove_torrent(h.get_torrent_handle(), session::delete_files);
|
|
||||||
} else {
|
|
||||||
s->remove_torrent(h.get_torrent_handle());
|
|
||||||
}
|
}
|
||||||
|
// Remove it from session
|
||||||
|
s->remove_torrent(h.get_torrent_handle());
|
||||||
// Remove it from torrent backup directory
|
// Remove it from torrent backup directory
|
||||||
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
|
||||||
QStringList filters;
|
QStringList filters;
|
||||||
@ -244,6 +247,12 @@ void bittorrent::deleteTorrent(QString hash, bool permanent) {
|
|||||||
std::cerr << "Error: Torrent " << hash.toStdString() << " is neither in finished or unfinished list\n";
|
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
|
// Return a list of hashes for the finished torrents
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
class downloadThread;
|
class downloadThread;
|
||||||
|
class deleteThread;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
|
||||||
class bittorrent : public QObject{
|
class bittorrent : public QObject{
|
||||||
@ -53,6 +54,7 @@ class bittorrent : public QObject{
|
|||||||
QHash<QString, QPair<size_type,size_type> > ratioData;
|
QHash<QString, QPair<size_type,size_type> > ratioData;
|
||||||
QTimer *ETARefresher;
|
QTimer *ETARefresher;
|
||||||
QHash<QString, QList<QPair<QString, QString> > > trackersErrors;
|
QHash<QString, QList<QPair<QString, QString> > > trackersErrors;
|
||||||
|
deleteThread *deleter;
|
||||||
QStringList waitingForPause;
|
QStringList waitingForPause;
|
||||||
QStringList finishedTorrents;
|
QStringList finishedTorrents;
|
||||||
QStringList unfinishedTorrents;
|
QStringList unfinishedTorrents;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user