From ea7eb7c0ec2221caaa0d01aaa966b1172ed85cf8 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 14 Mar 2018 14:24:44 +0800 Subject: [PATCH] Add delay before processing FS changes This prevents file renaming errors in monitored folder on linux, for example: ABC.torrent.part -> ABC.torrent --- src/base/filesystemwatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/filesystemwatcher.cpp b/src/base/filesystemwatcher.cpp index 1e00817a5..b5f9b2308 100644 --- a/src/base/filesystemwatcher.cpp +++ b/src/base/filesystemwatcher.cpp @@ -124,7 +124,7 @@ void FileSystemWatcher::removePath(const QString &path) void FileSystemWatcher::scanLocalFolder(const QString &path) { - processTorrentsInDir(path); + QTimer::singleShot(2000, this, [this, path]() { processTorrentsInDir(path); }); } #ifndef Q_OS_WIN