summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2014-11-20 17:34:31 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2014-11-20 18:11:47 +0100
commitde34e0e30b93eb9f245b668e2cf9513a7e6abd50 (patch)
tree5b44d1aa271a7fef15803982f8572b6bc6d32889 /share
parent3382efb71e8e200eb54068d81de1cc14c84f0f4c (diff)
downloadqt-creator-de34e0e30b93eb9f245b668e2cf9513a7e6abd50.tar.gz
FormWizard: Fix newlines being escaped in generated output
Export the form contents as a list of lines and join them when needed instead of hoping to unescape '\\n' in all places where it is necessary. This approach should be a bit saver since it will cause parse errors in the wizard, which are more visible than broken output in the generated files. Task-number: QTCREATORBUG-13456 Change-Id: I434a9227082f92be3c2ce75006f61ac79a2b6fd6 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/templates/wizards/files/form/file.ui2
-rw-r--r--share/qtcreator/templates/wizards/files/form/wizard.json2
2 files changed, 2 insertions, 2 deletions
diff --git a/share/qtcreator/templates/wizards/files/form/file.ui b/share/qtcreator/templates/wizards/files/form/file.ui
index a12c1fffb0..d83113033f 100644
--- a/share/qtcreator/templates/wizards/files/form/file.ui
+++ b/share/qtcreator/templates/wizards/files/form/file.ui
@@ -1 +1 @@
-%{FormContents}\
+%{JS: [ %{FormContents} ].join('\n')}\
diff --git a/share/qtcreator/templates/wizards/files/form/wizard.json b/share/qtcreator/templates/wizards/files/form/wizard.json
index 510f2d0ae1..835ccf8ffb 100644
--- a/share/qtcreator/templates/wizards/files/form/wizard.json
+++ b/share/qtcreator/templates/wizards/files/form/wizard.json
@@ -10,7 +10,7 @@
"featuresRequired": [ "Plugin.Designer" ],
"options": [
- { "key": "UiClass", "value": "%{JS: QtSupport.uiClassName('%{FormContents}') }" },
+ { "key": "UiClass", "value": "%{JS: QtSupport.uiClassName([ %{FormContents} ].join('\\n'))}" },
{ "key": "Extension", "value": "%{JS: Util.preferredSuffix('application/x-designer')}"},
{ "key": "InitialFileName", "value": "%{JS: Cpp.classToFileName('%{UiClass}', '%{Extension}') }" }
],