Skip to content

Commit

Permalink
- Make sure that scan directory is not qBittorrent backup folder to a…
Browse files Browse the repository at this point in the history
…void torrent deletion
  • Loading branch information
Christophe Dumez committed Nov 4, 2009
1 parent 7fc0b02 commit 66590bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bittorrent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,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);
Expand Down

0 comments on commit 66590bf

Please sign in to comment.