| 1656 | } |
| 1657 | |
| 1658 | void 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 | |
| 1674 | void App::onWidgetFocusChange( UIWidget* widget ) { |
| 1675 | if ( mConfig.editor.showDocInfo && mDocInfo ) |
nothing calls this directly
no test coverage detected