summaryrefslogtreecommitdiff
path: root/src/plugins/qmljstools/qmljsrefactoringchanges.cpp
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2011-02-01 14:13:54 +0100
committerLeandro Melo <leandro.melo@nokia.com>2011-02-21 17:22:24 +0100
commitea313f3ec84692c6112ad2a0f7d47909dafbb69c (patch)
treee952cb85d0e9ca8d974d2c44f8dc4396a1cc0026 /src/plugins/qmljstools/qmljsrefactoringchanges.cpp
parentcbafc50acc48d75a1fc993e72bcb6587f8bb9a4e (diff)
downloadqt-creator-ea313f3ec84692c6112ad2a0f7d47909dafbb69c.tar.gz
Text editor: Introduce per project settings
With some refactorings to make the code look better. Reviewed-by: con
Diffstat (limited to 'src/plugins/qmljstools/qmljsrefactoringchanges.cpp')
-rw-r--r--src/plugins/qmljstools/qmljsrefactoringchanges.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp
index 3a5be7597b..0b8704ab63 100644
--- a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp
+++ b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp
@@ -38,6 +38,7 @@
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/tabsettings.h>
+#include <projectexplorer/editorconfiguration.h>
using namespace QmlJS;
using namespace QmlJSTools;
@@ -60,7 +61,9 @@ QmlJSRefactoringFile QmlJSRefactoringChanges::file(const QString &fileName)
return QmlJSRefactoringFile(fileName, this);
}
-void QmlJSRefactoringChanges::indentSelection(const QTextCursor &selection) const
+void QmlJSRefactoringChanges::indentSelection(const QTextCursor &selection,
+ const QString &fileName,
+ const TextEditor::BaseTextEditor *textEditor) const
{
// ### shares code with QmlJSTextEditor::indent
QTextDocument *doc = selection.document();
@@ -68,7 +71,8 @@ void QmlJSRefactoringChanges::indentSelection(const QTextCursor &selection) cons
QTextBlock block = doc->findBlock(selection.selectionStart());
const QTextBlock end = doc->findBlock(selection.selectionEnd()).next();
- const TextEditor::TabSettings &tabSettings(TextEditor::TextEditorSettings::instance()->tabSettings());
+ const TextEditor::TabSettings &tabSettings =
+ ProjectExplorer::actualTabSettings(fileName, textEditor);
QtStyleCodeFormatter codeFormatter(tabSettings);
codeFormatter.updateStateUntil(block);