changeset 551:72d7b23f77cd

Made the syntax highligter selection be only handled in the highlighter class and not also in mainwindow. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@791 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Wed, 01 Oct 2008 17:07:43 +0000
parents 5aa6e7af4ca9
children a7affad41c13
files src/mainwindow.cpp src/mainwindow.h
diffstat 2 files changed, 1 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Wed Oct 01 16:54:26 2008 +0000
+++ b/src/mainwindow.cpp	Wed Oct 01 17:07:43 2008 +0000
@@ -1135,20 +1135,7 @@
 	highlighterMenu->addActions( highlighterActionGroup->actions() );
     menuSettings->insertMenu(indenterParameterTooltipsEnabledAction, highlighterMenu );
 
-	connect( highlighterActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(highlighterChanged(QAction*)) );
-}
-
-
-/*!
-    \brief This slot handles signals coming from selecting another syntax highlighter.
- */
-void MainWindow::highlighterChanged(QAction* highlighterAction) {
-	QString highlighterName = highlighterAction->text();
-    highlighter->setLexerByName( highlighterName );
-    //TODO: This is really no nice way. How do it better?
-    // Need to do this "text update" to update the syntax highlighting. Otherwise highlighting is wrong.
-    previewToggled = true;
-    updateSourceView();
+	connect( highlighterActionGroup, SIGNAL(triggered(QAction*)), highlighter, SLOT(setHighlighterByAction(QAction*)) );
 }
 
 
--- a/src/mainwindow.h	Wed Oct 01 16:54:26 2008 +0000
+++ b/src/mainwindow.h	Wed Oct 01 17:07:43 2008 +0000
@@ -137,7 +137,6 @@
     void exportToHTML();
 	void languageChanged(int languageIndex);
     void encodingChanged(QAction *encodingAction);
-    void highlighterChanged(QAction* highlighterAction);
 	void numberOfLinesChanged();
     void updateRecentlyOpenedList();
     void openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction);