MCPcopy Create free account
hub / github.com/SpartanJ/eepp / loadDirTree

Method loadDirTree

src/tools/ecode/ecode.cpp:3457–3495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3455}
3456
3457void App::loadDirTree( const std::string& path ) {
3458 Clock clock;
3459 mDirTreeReady = false;
3460 mDirTree = std::make_shared<ProjectDirectoryTree>(
3461 path, mThreadPool, mPluginManager.get(),
3462 [this]( auto path ) { loadFileFromPathOrFocus( path ); } );
3463 Log::info( "Loading DirTree: %s", path );
3464 std::vector<std::string> supportedExts(
3465 SyntaxDefinitionManager::instance()->getExtensionsPatternsSupported() );
3466 auto imgExts( Image::getImageExtensionsSupported() );
3467 supportedExts.reserve( supportedExts.size() + imgExts.size() );
3468 for ( auto& ext : imgExts ) {
3469 ext.insert( 0, "%." );
3470 ext += "$";
3471 supportedExts.push_back( ext );
3472 }
3473 mDirTree->scan(
3474 [this, clock]( ProjectDirectoryTree& dirTree ) {
3475 Log::info( "DirTree read in: %s. Found %ld files.", clock.getElapsedTime().toString(),
3476 dirTree.getFilesCount() );
3477 mDirTreeReady = true;
3478 mUISceneNode->runOnMainThread( [this] {
3479 mUniversalLocator->updateFilesTable();
3480 if ( mSplitter->curEditorExistsAndFocused() )
3481 syncProjectTreeWithEditor( mSplitter->getCurEditor() );
3482 } );
3483 removeFolderWatches();
3484 if ( mFileWatcher ) {
3485 {
3486 Lock l( mWatchesLock );
3487 mFolderWatches.insert( { dirTree.getPath(), 0 } );
3488 }
3489 mFolderWatches[dirTree.getPath()] =
3490 mFileWatcher->addWatch( dirTree.getPath(), mFileSystemListener, true );
3491 }
3492 mFileSystemListener->setDirTree( mDirTree );
3493 },
3494 supportedExts );
3495}
3496
3497UIMessageBox* App::errorMsgBox( const String& msg ) {
3498 UIMessageBox* msgBox = UIMessageBox::New( UIMessageBox::OK, msg );

Callers

nothing calls this directly

Calls 15

infoFunction · 0.85
reserveMethod · 0.80
push_backMethod · 0.80
scanMethod · 0.80
getElapsedTimeMethod · 0.80
getFilesCountMethod · 0.80
runOnMainThreadMethod · 0.80
updateFilesTableMethod · 0.80
getCurEditorMethod · 0.80
setDirTreeMethod · 0.80

Tested by

no test coverage detected