ecode: Improved file system listener.

This commit is contained in:
Martín Lucas Golini
2023-07-25 00:42:10 -03:00
parent 451ffc75ad
commit cf13a5aa5d
3 changed files with 13 additions and 3 deletions

View File

@@ -324,8 +324,11 @@ void ProjectDirectoryTree::tryAddFile( const FileInfo& file ) {
}
if ( foundPattern ) {
Lock l( mFilesMutex );
mFiles.emplace_back( file.getFilepath() );
mNames.emplace_back( file.getFileName() );
auto exists = std::find( mFiles.begin(), mFiles.end(), file.getFilepath() ) != mFiles.end();
if ( !exists ) {
mFiles.emplace_back( file.getFilepath() );
mNames.emplace_back( file.getFileName() );
}
}
}
}