Commit 33a12200 authored by Tobias Hunger's avatar Tobias Hunger

JsonWizard: Fix expansion of complex macros

Fix expansion of bool macros and empty string macros embedded into
other macros.

Change-Id: I7d65a4692c48c6299956cc8c4c2c28efb1c8e149
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent de5f22a9
......@@ -128,10 +128,14 @@ QString JsonWizard::stringValue(const QString &n) const
return QString();
if (v.type() == QVariant::Bool)
return v.toBool() ? QString::fromLatin1("true") : QString();
return v.toBool() ? QString::fromLatin1("true") : QString::fromLatin1("false");
if (v.type() == QVariant::String)
return m_expander.expand(v.toString());
if (v.type() == QVariant::String) {
QString tmp = m_expander.expand(v.toString());
if (tmp.isEmpty())
tmp = QString::fromLatin1(""); // Make sure isNull() is *not* true.
return tmp;
}
if (v.type() == QVariant::StringList)
return stringListToArrayString(v.toStringList(), &m_expander);
......
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