From 33a122001948020674246d60faea5bdc0b11bc0b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 3 Jun 2015 09:55:47 +0200 Subject: [PATCH] JsonWizard: Fix expansion of complex macros Fix expansion of bool macros and empty string macros embedded into other macros. Change-Id: I7d65a4692c48c6299956cc8c4c2c28efb1c8e149 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index dd5bd007ce2..87d908544d4 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -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);