summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/projectfilewizardextension.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-08-21 14:39:18 +0200
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-08-21 14:39:18 +0200
commitc2e90c360baaa5b8ea31d4466cadfab2bda3aabe (patch)
tree33ff2ee485894273b947b0c89a47dac75c8db3b1 /src/plugins/projectexplorer/projectfilewizardextension.cpp
parentbf69b4c4446fbcc5feb94edcc89ff87078b2afcf (diff)
parent01b3e1fa547d8def812d64941968fb5e13516383 (diff)
downloadqt-creator-c2e90c360baaa5b8ea31d4466cadfab2bda3aabe.tar.gz
Merge remote-tracking branch 'origin/2.8'
Conflicts: src/plugins/cpptools/cppcompletion_test.cpp src/plugins/cpptools/cpptoolsplugin.h src/plugins/projectexplorer/customtoolchain.cpp src/plugins/vcsbase/command.cpp Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
Diffstat (limited to 'src/plugins/projectexplorer/projectfilewizardextension.cpp')
-rw-r--r--src/plugins/projectexplorer/projectfilewizardextension.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp
index 9db36e72ba..2475c90b48 100644
--- a/src/plugins/projectexplorer/projectfilewizardextension.cpp
+++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp
@@ -48,6 +48,7 @@
#include <texteditor/icodestylepreferencesfactory.h>
#include <texteditor/normalindenter.h>
#include <texteditor/tabsettings.h>
+#include <texteditor/storagesettings.h>
#include <projectexplorer/project.h>
#include <projectexplorer/editorconfiguration.h>
@@ -571,13 +572,19 @@ void ProjectFileWizardExtension::applyCodeStyle(Core::GeneratedFile *file) const
TextEditor::ICodeStylePreferences *codeStylePrefs = codeStylePreferences(baseProject, languageId);
indenter->setCodeStylePreferences(codeStylePrefs);
-
QTextDocument doc(file->contents());
QTextCursor cursor(&doc);
cursor.select(QTextCursor::Document);
indenter->indent(&doc, cursor, QChar::Null, codeStylePrefs->currentTabSettings());
- file->setContents(doc.toPlainText());
delete indenter;
+ if (TextEditor::TextEditorSettings::instance()->storageSettings().m_cleanWhitespace) {
+ QTextBlock block = doc.firstBlock();
+ while (block.isValid()) {
+ codeStylePrefs->currentTabSettings().removeTrailingWhitespace(cursor, block);
+ block = block.next();
+ }
+ }
+ file->setContents(doc.toPlainText());
}
QStringList ProjectFileWizardExtension::getProjectChoices() const