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

Method loadFileFromPathInNewTab

src/eepp/ui/tools/uicodeeditorsplitter.cpp:446–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446std::pair<UITab*, UICodeEditor*>
447UICodeEditorSplitter::loadFileFromPathInNewTab( const std::string& path ) {
448 auto d = createCodeEditorInTabWidget( getPreferredTabWidget() );
449 if ( d.first == nullptr || d.second == nullptr ) {
450 if ( !mTabWidgets.empty() && mTabWidgets[0]->getTabCount() > 0 ) {
451 d = createCodeEditorInTabWidget( mTabWidgets[0] );
452 } else {
453 Log::error( "Couldn't createCodeEditorInTabWidget in "
454 "UICodeEditorSplitter::loadFileFromPathInNewTab" );
455 return d;
456 }
457 }
458 UITabWidget* tabWidget = d.first->getTabWidget();
459 loadFileFromPath( path, d.second );
460 tabWidget->setTabSelected( d.first );
461 return d;
462}
463
464void UICodeEditorSplitter::loadAsyncFileFromPathInNewTab(
465 const std::string& path, std::function<void( UICodeEditor*, const std::string& )> onLoaded,

Callers 3

loadBaseStyleSheetMethod · 0.80
loadStyleSheetMethod · 0.80
loadLayoutMethod · 0.80

Calls 5

errorFunction · 0.85
getTabCountMethod · 0.80
emptyMethod · 0.45
getTabWidgetMethod · 0.45
setTabSelectedMethod · 0.45

Tested by

no test coverage detected