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

Method loadDiffFromPaths

src/tools/ecode/ecode.cpp:2731–2749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2729}
2730
2731void App::loadDiffFromPaths( const std::string& oldPath, const std::string& newPath ) {
2732 auto diffViewTitle = i18n( "diff_viewer", "Diff Viewer" );
2733 auto* diffView = Tools::UIDiffView::New();
2734 auto [tab, iv] = mSplitter->createWidget( diffView, i18n( "diff_viewer", "Diff Viewer" ) );
2735 if ( !newPath.empty() ) {
2736 std::string fileName = FileSystem::fileNameFromPath( newPath );
2737 tab->setText( diffViewTitle + ": " + fileName );
2738 tab->setTooltipText( newPath );
2739 } else {
2740 tab->setText( diffViewTitle );
2741 }
2742 auto icon = findIcon( "filetype-diff" );
2743 tab->setIcon( icon ? icon : findIcon( "file" ) );
2744
2745 diffView->setHeadersVisible( true );
2746 diffView->loadFromFile( oldPath, newPath );
2747 diffView->setSyntaxColorScheme( *getCurrentColorScheme() );
2748 registerUnlockedCommands( *diffView );
2749}
2750
2751void App::loadDiffFromStrings( const std::string& str, const std::string& otherStr ) {
2752 auto diffViewTitle = i18n( "diff_viewer", "Diff Viewer" );

Callers 1

diffMethod · 0.80

Calls 9

setTooltipTextMethod · 0.80
setSyntaxColorSchemeMethod · 0.80
NewFunction · 0.50
createWidgetMethod · 0.45
emptyMethod · 0.45
setTextMethod · 0.45
setIconMethod · 0.45
setHeadersVisibleMethod · 0.45
loadFromFileMethod · 0.45

Tested by

no test coverage detected