From 50241224d0e4cb3823a09f6d0bc10d2e5b755c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 19 Nov 2022 14:11:40 +0100 Subject: [PATCH] GUI: better exclude of files. the canonical Qt method might return absolute paths from relative input paths. --- gui/filelist.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/filelist.cpp b/gui/filelist.cpp index dd5fc26fd..31a5c9940 100644 --- a/gui/filelist.cpp +++ b/gui/filelist.cpp @@ -126,9 +126,11 @@ QStringList FileList::applyExcludeList() const QStringList paths; for (const QFileInfo& item : mFileList) { - QString name = QDir::fromNativeSeparators(item.canonicalFilePath()); - if (!pathMatch.match(name.toStdString())) - paths << name; + if (pathMatch.match(QDir::fromNativeSeparators(item.filePath()).toStdString())) + continue; + QString canonical = QDir::fromNativeSeparators(item.canonicalFilePath()); + if (!pathMatch.match(canonical.toStdString())) + paths << canonical; } return paths; }