From b4e8f0312c1bf7829a5dccbb142094d3bc960dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 21 Aug 2026 19:22:39 -0300 Subject: [PATCH] Fixed the ProjectDirectoryTree ignore regression... --- src/tools/ecode/projectdirectorytree.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/tools/ecode/projectdirectorytree.cpp b/src/tools/ecode/projectdirectorytree.cpp index 8d8da2691..5851a86bf 100644 --- a/src/tools/ecode/projectdirectorytree.cpp +++ b/src/tools/ecode/projectdirectorytree.cpp @@ -460,13 +460,29 @@ void ProjectDirectoryTree::addFile( const FileInfo& file ) { if ( mIgnoreHidden && file.isHidden() ) return; Lock rl( mMatchingMutex ); - Lock l( mFilesMutex ); - std::string directory( file.getFilepath() ); + const std::string& directoryEntry = file.getFilepath(); + IgnoreMatcherManager matcher( getIgnoreMatcherFromPath( directoryEntry ) ); + if ( matcher.foundMatch() && matcher.match( file ) ) { + if ( !mAllowedMatcher || !mAllowedMatcher->hasPatterns() ) + return; + std::string_view localPath( directoryEntry ); + if ( String::startsWith( directoryEntry, mAllowedMatcher->getPath() ) ) + localPath.remove_prefix( mAllowedMatcher->getPath().size() ); + if ( !mAllowedMatcher->match( localPath ) ) + return; + } else if ( mDisallowedMatcher && mDisallowedMatcher->hasPatterns() ) { + std::string_view localPath( directoryEntry ); + if ( String::startsWith( directoryEntry, mDisallowedMatcher->getPath() ) ) + localPath.remove_prefix( mDisallowedMatcher->getPath().size() ); + if ( mDisallowedMatcher->match( localPath ) ) + return; + } + std::string directory( directoryEntry ); FileSystem::dirAddSlashAtEnd( directory ); + Lock l( mFilesMutex ); std::vector files; std::vector names; std::set info; - IgnoreMatcherManager matcher( getIgnoreMatcherFromPath( directory ) ); { Lock ld( mDirectoriesMutex ); mDirectories.emplace_back( directory );