QtSupport: Fix header guard for ui files

First fix to generate header guards was creating collision with other
header guards. So we now do not generate header guards anymore but
prepend "#pragma once".

Change-Id: I153a874f676188ef47e02e333691e8998f5a6558
Fixes: QTCREATORBUG-22624
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Marco Bubke
2019-07-04 12:53:10 +02:00
parent 6a58666f44
commit 47312b04c0

View File

@@ -67,7 +67,7 @@ Utils::FilePath UicGenerator::command() const
QStringList UicGenerator::arguments() const QStringList UicGenerator::arguments() const
{ {
return {source().toString()}; return {"-p", source().toString()};
} }
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process) FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
@@ -81,7 +81,9 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
return result; return result;
// As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The // As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The
// conversion below is to normalize both the encoding, and the line terminators. // conversion below is to normalize both the encoding, and the line terminators.
result[targetList.first()] = QString::fromLocal8Bit(process->readAllStandardOutput()).toUtf8(); QByteArray content = QString::fromLocal8Bit(process->readAllStandardOutput()).toUtf8();
content.prepend("#pragma once\n");
result[targetList.first()] = content;
return result; return result;
} }