mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
- Folder Scanning: initial import of the torrents inside is fixed
This commit is contained in:
@@ -139,6 +139,7 @@ public:
|
||||
} else {
|
||||
#endif
|
||||
// Normal mode
|
||||
qDebug("FS Watching is watching %s in normal mode", path.toLocal8Bit().data());
|
||||
QFileSystemWatcher::addPath(path);
|
||||
scanFolder();
|
||||
#ifndef Q_WS_WIN
|
||||
@@ -165,11 +166,14 @@ public:
|
||||
protected slots:
|
||||
// XXX: Does not detect file size changes to improve performance.
|
||||
void scanFolder() {
|
||||
qDebug("Scan folder was called");
|
||||
QStringList torrents;
|
||||
if(watch_timer)
|
||||
if(watch_timer) {
|
||||
torrents = watched_folder.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||
else
|
||||
} else {
|
||||
torrents = QDir(QFileSystemWatcher::directories().first()).entryList(filters, QDir::Files, QDir::Unsorted);
|
||||
qDebug("FSWatcher: Polling manually folder %s", QFileSystemWatcher::directories().first().toLocal8Bit().data());
|
||||
}
|
||||
if(!torrents.empty())
|
||||
emit torrentsAdded(torrents);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user