ProjectMacro: Prettify output of toByteArray

Remove a stray space in the output if the value of a #define is empty.

Change-Id: I542c092416e00276dc72e31b43215349ecf1ca64
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Tobias Hunger
2017-09-20 11:53:01 +02:00
parent 32ce2119d6
commit 39bf2257c5

View File

@@ -38,7 +38,11 @@ bool Macro::isValid() const
QByteArray Macro::toByteArray() const
{
switch (type) {
case MacroType::Define: return QByteArray("#define ") + key + ' ' + value;
case MacroType::Define: {
if (value.isEmpty())
return QByteArray("#define ") + key;
return QByteArray("#define ") + key + ' ' + value;
}
case MacroType::Undefine: return QByteArray("#undef ") + key;
case MacroType::Invalid: break;
}