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

Method onRealDocumentLoaded

src/tools/ecode/ecode.cpp:2061–2093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2059}
2060
2061void App::onRealDocumentLoaded( UICodeEditor* editor, const std::string& path ) {
2062 updateEditorTitle( editor );
2063 if ( mSplitter->curEditorExistsAndFocused() && editor == mSplitter->getCurEditor() )
2064 mSettings->updateCurrentFileType();
2065 mSplitter->removeUnusedTab( mSplitter->tabWidgetFromEditor( editor ) );
2066 insertRecentFileAndUpdateUI( path );
2067 if ( mSplitter->curEditorExistsAndFocused() && mSplitter->getCurEditor() == editor ) {
2068 mSettings->updateDocumentMenu();
2069 updateDocInfo( editor->getDocument() );
2070 }
2071
2072 if ( !path.empty() ) {
2073 UITab* tab = reinterpret_cast<UITab*>( editor->getData() );
2074 tab->setTooltipText( path );
2075 }
2076
2077 TextDocument& doc = editor->getDocument();
2078 std::string filePath =
2079 doc.hasFilepath() ? doc.getFilePath()
2080 : ( !doc.getLoadingFilePath().empty() ? doc.getLoadingFilePath() : "" );
2081
2082 if ( mFileWatcher && !filePath.empty() &&
2083 ( !mDirTree || !mDirTree->isDirInTree( filePath ) ) ) {
2084 std::string dir( FileSystem::fileRemoveFileName( filePath ) );
2085 mThreadPool->run( [this, dir] {
2086 if ( mFileWatcher && !dirInFolderWatches( dir ) ) {
2087 auto watchId = mFileWatcher->addWatch( dir, mFileSystemListener );
2088 Lock l( mWatchesLock );
2089 mFilesFolderWatches[dir] = watchId;
2090 }
2091 } );
2092 }
2093}
2094
2095void App::onDocumentLoaded( UICodeEditor* editor, const std::string& path ) {
2096 if ( editor->getData() == 0 )

Callers

nothing calls this directly

Calls 15

getCurEditorMethod · 0.80
updateCurrentFileTypeMethod · 0.80
removeUnusedTabMethod · 0.80
tabWidgetFromEditorMethod · 0.80
updateDocumentMenuMethod · 0.80
getDocumentMethod · 0.80
setTooltipTextMethod · 0.80
hasFilepathMethod · 0.80
getFilePathMethod · 0.80
getLoadingFilePathMethod · 0.80
isDirInTreeMethod · 0.80

Tested by

no test coverage detected