| 2729 | } |
| 2730 | |
| 2731 | void 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 | |
| 2751 | void App::loadDiffFromStrings( const std::string& str, const std::string& otherStr ) { |
| 2752 | auto diffViewTitle = i18n( "diff_viewer", "Diff Viewer" ); |
no test coverage detected