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

Method syncProjectTreeWithEditor

src/tools/ecode/ecode.cpp:1658–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1656}
1657
1658void App::syncProjectTreeWithEditor( UICodeEditor* editor ) {
1659 if ( mProjectTreeView && mConfig.editor.syncProjectTreeWithEditor && editor != nullptr &&
1660 ( editor->getDocument().hasFilepath() ||
1661 !editor->getDocument().getLoadingFilePath().empty() ) ) {
1662 std::string loadingPath( editor->getDocument().getLoadingFilePath() );
1663 std::string path = !loadingPath.empty() ? loadingPath : editor->getDocument().getFilePath();
1664 mProjectTreeView->setFocusOnSelection( false );
1665 if ( !mCurrentProject.empty() && String::startsWith( path, mCurrentProject ) ) {
1666 mProjectTreeView->openRowWithPath( path.substr( mCurrentProject.size() ) );
1667 } else {
1668 mProjectTreeView->openRowWithPath( FileSystem::fileNameFromPath( path ) );
1669 }
1670 mProjectTreeView->setFocusOnSelection( true );
1671 }
1672}
1673
1674void App::onWidgetFocusChange( UIWidget* widget ) {
1675 if ( mConfig.editor.showDocInfo && mDocInfo )

Callers

nothing calls this directly

Calls 9

hasFilepathMethod · 0.80
getDocumentMethod · 0.80
getLoadingFilePathMethod · 0.80
getFilePathMethod · 0.80
setFocusOnSelectionMethod · 0.80
openRowWithPathMethod · 0.80
substrMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected