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

Method updateFilesTable

src/tools/ecode/universallocator.cpp:343–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343void UniversalLocator::updateFilesTable( bool useGlob ) {
344 auto text = mLocateInput->getText();
345
346 if ( pathHasPosition( text ) ) {
347 auto pathAndPos = getPathAndPosition( text );
348 text = pathAndPos.first;
349 }
350
351 if ( useGlob && String::startsWith( text, "g " ) )
352 text = text.substr( 2 );
353
354 if ( !mApp->isDirTreeReady() ) {
355 mLocateTable->setModel(
356 ProjectDirectoryTree::emptyModel( getLocatorCommands(), mApp->getCurrentProject() ) );
357 mLocateTable->getSelection().set( mLocateTable->getModel()->index( 0 ) );
358 } else if ( !mLocateInput->getText().empty() ) {
359 mApp->getDirTree()->asyncMatchTree(
360 useGlob ? ProjectDirectoryTree::MatchType::Glob
361 : ProjectDirectoryTree::MatchType::Fuzzy,
362 text, LOCATEBAR_MAX_RESULTS,
363 [this, text]( auto res ) {
364 mUISceneNode->runOnMainThread( [this, res] {
365 mLocateTable->setModel( res );
366 mLocateTable->getSelection().set( mLocateTable->getModel()->index( 0 ) );
367 mLocateTable->scrollToTop();
368 updateLocateBarSync();
369 } );
370 },
371 mApp->getCurrentProject() );
372 } else {
373 mLocateTable->setModel( mApp->getDirTree()->asModel(
374 LOCATEBAR_MAX_RESULTS, getLocatorCommands(), mApp->getCurrentProject(),
375 Image::getImageExtensionsSupported() ) );
376 mLocateTable->getSelection().set( mLocateTable->getModel()->index( 0 ) );
377 }
378}
379
380void UniversalLocator::updateCommandPaletteTable() {
381 if ( !mCommandPalette.isSet() )

Callers 2

closeFolderMethod · 0.80
loadDirTreeMethod · 0.80

Calls 15

pathHasPositionFunction · 0.85
getPathAndPositionFunction · 0.85
substrMethod · 0.80
isDirTreeReadyMethod · 0.80
asyncMatchTreeMethod · 0.80
getDirTreeMethod · 0.80
runOnMainThreadMethod · 0.80
scrollToTopMethod · 0.80
getTextMethod · 0.45
setModelMethod · 0.45
setMethod · 0.45
getSelectionMethod · 0.45

Tested by

no test coverage detected