- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion

This commit is contained in:
Christophe Dumez
2009-11-04 10:51:53 +00:00
parent 7a7fca0d0c
commit 94a8c88bd9
2 changed files with 7 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
- BUGFIX: Fix crash on torrent addition (if libtorrent-rasterbar has debug enabled)
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
- BUGFIX: Updated man page

View File

@@ -982,6 +982,12 @@ void bittorrent::scanDirectory(QString scan_dir) {
FSMutex->lock();
qDebug("Scanning directory: %s", scan_dir.toLocal8Bit().data());
QDir dir(scan_dir);
QDir torrentBackup(misc::qBittorrentPath() + "BT_backup");
// Check that scan dir is not BT_backup (silly but who knows...)
if(dir == torrentBackup) {
std::cerr << "Scan directory cannot be qBittorrent backup folder!" << std::endl;
return;
}
QStringList filters;
filters << "*.torrent";
QStringList files = dir.entryList(filters, QDir::Files, QDir::Unsorted);