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>
This commit is contained in:
Tobias Hunger
2014-11-20 17:34:31 +01:00
parent 3382efb71e
commit de34e0e30b
4 changed files with 11 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ bool FormTemplateWizardPage::validatePage()
QMessageBox::critical(this, tr("%1 - Error").arg(title()), errorMessage);
return false;
}
wizard()->setProperty("FormContents", m_templateContents.replace(QLatin1Char('\n'), QLatin1String("\\n")));
wizard()->setProperty("FormContents", m_templateContents.split(QLatin1Char('\n')));
return true;
}