Commit 39bf2257 authored by Tobias Hunger's avatar Tobias Hunger

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's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 32ce2119
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment