mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
ecode: Improved file system listener.
This commit is contained in:
2
src/thirdparty/efsw
vendored
2
src/thirdparty/efsw
vendored
Submodule src/thirdparty/efsw updated: ac1a2fc2cb...a2a0e475ca
@@ -70,12 +70,19 @@ void FileSystemListener::handleFileAction( efsw::WatchID, const std::string& dir
|
||||
}
|
||||
}
|
||||
|
||||
if ( file.isLink() )
|
||||
file = FileInfo( file.linksTo() );
|
||||
|
||||
if ( isFileOpen( file ) )
|
||||
notifyChange( file );
|
||||
|
||||
Lock l( mCbsMutex );
|
||||
if ( !mCbs.empty() ) {
|
||||
auto cbs = mCbs;
|
||||
for ( const auto& cb : cbs )
|
||||
cb.second( event, file );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case efsw::Actions::Modified: {
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user