From ec9d541bbd23aad890ad59247358cc2b78bef9f7 Mon Sep 17 00:00:00 2001 From: Ryu481 <142620516+Ryu481@users.noreply.github.com> Date: Mon, 14 Jul 2025 19:44:57 +0200 Subject: [PATCH] Don't leave an empty folder when deleting or moving torrents Currently when you delete or move a torrent sometimes an empty folder will stay. This is because hidden files will stay which didn't got deleted. The reason that it is not working is that QDir::Files is used which doesn't lists hidden files. Adding QDir::Hidden will make the code work as expected. At least on Windows and macOS QDir::Files doesn't lists hidden files. I can't test on linux. PR #22983. --- src/base/utils/fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/utils/fs.cpp b/src/base/utils/fs.cpp index 4dd02e3de..d0ac3bbc3 100644 --- a/src/base/utils/fs.cpp +++ b/src/base/utils/fs.cpp @@ -104,7 +104,7 @@ bool Utils::Fs::smartRemoveEmptyFolderTree(const Path &path) if (!dir.isEmpty(QDir::Dirs | QDir::NoDotAndDotDot)) continue; - const QStringList tmpFileList = dir.entryList(QDir::Files); + const QStringList tmpFileList = dir.entryList(QDir::Files | QDir::Hidden); // deleteFilesList contains unwanted files, usually created by the OS // temp files on linux usually end with '~', e.g. `filename~`