forked from qt-creator/qt-creator
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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user