| 2059 | } |
| 2060 | |
| 2061 | void 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 | |
| 2095 | void App::onDocumentLoaded( UICodeEditor* editor, const std::string& path ) { |
| 2096 | if ( editor->getData() == 0 ) |
nothing calls this directly
no test coverage detected