Add into settings default line ending for new files

Add option into the Qt Creator settings option to configure what line
ending will the newly create files have.

Change-Id: I0fa67a54c78524dc943c01acb925c1bac1e47cc1
Fixes: QTCREATORBUG-3590
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marius Sincovici
2019-09-03 22:37:25 +02:00
parent c802a1b12a
commit 909c6800e6
10 changed files with 48 additions and 2 deletions

View File

@@ -215,7 +215,9 @@ TextFileFormat::ReadResult readTextFile(const QString &fileName, const QTextCode
return TextFileFormat::ReadMemoryAllocationError;
}
*format = TextFileFormat::detect(data);
if (!data.isEmpty())
*format = TextFileFormat::detect(data);
if (!format->codec)
format->codec = defaultCodec ? defaultCodec : QTextCodec::codecForLocale();