rcc compiler with -list on Windows (newline symbols)

Suppress '\n' -> '\r\n' replacement done by QIODevice, on Windows
fwrite to stdout will end up in such replacement, no need in
\r\r\n (reported as a bug in QtQuickCompiler originally).)

Task-number: QTRD-3497
Change-Id: I61010831b49e41b3e4fa6626054f9fb53c63bb8a
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Timur Pocheptsov 2015-10-26 14:19:23 +01:00
parent b77ef8a7e6
commit 53d5811b0c

View File

@ -255,6 +255,11 @@ int runRcc(int argc, char *argv[])
// Make sure fwrite to stdout doesn't do LF->CRLF // Make sure fwrite to stdout doesn't do LF->CRLF
if (library.format() == RCCResourceLibrary::Binary) if (library.format() == RCCResourceLibrary::Binary)
_setmode(_fileno(stdout), _O_BINARY); _setmode(_fileno(stdout), _O_BINARY);
// Make sure QIODevice does not do LF->CRLF,
// otherwise we'll end up in CRCRLF instead of
// CRLF.
if (list)
mode &= ~QIODevice::Text;
#endif // Q_OS_WIN #endif // Q_OS_WIN
// using this overload close() only flushes. // using this overload close() only flushes.
out.open(stdout, mode); out.open(stdout, mode);