| 845 | } |
| 846 | |
| 847 | void UIDiffView::loadFromFile( const std::string& oldFilePath, const std::string& newFilePath ) { |
| 848 | std::string oldText, newText; |
| 849 | FileSystem::fileGet( oldFilePath, oldText ); |
| 850 | FileSystem::fileGet( newFilePath, newText ); |
| 851 | |
| 852 | auto def = SyntaxDefinitionManager::instance()->getByExtension( newFilePath ); |
| 853 | mSyntaxDef = |
| 854 | SyntaxDefinitionManager::instance()->getLanguageDefinition( def.getLanguageIndex() ); |
| 855 | mEditor->getDocument().setSyntaxDefinition( def ); |
| 856 | mLeftEditor->getDocument().setSyntaxDefinition( def ); |
| 857 | mRightEditor->getDocument().setSyntaxDefinition( def ); |
| 858 | mFileName = FileSystem::fileNameFromPath( newFilePath ); |
| 859 | |
| 860 | loadFromStrings( oldText, newText ); |
| 861 | } |
| 862 | |
| 863 | void UIDiffView::updateButtonsText() { |
| 864 | mModeToggle->setText( i18n( "diffview_side_by_side", "Side by Side" ) ); |
no test coverage detected