forked from qt-creator/qt-creator
JsonWizard: Simplify handling of bools via JS
Change-Id: I5381e83f6714886b7bf8cbcb859e1dd3b115a6c3 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -155,8 +155,10 @@ QVariant JsonWizard::value(const QString &n) const
|
||||
|
||||
bool JsonWizard::boolFromVariant(const QVariant &v, Utils::MacroExpander *expander)
|
||||
{
|
||||
if (v.type() == QVariant::String)
|
||||
return !expander->expand(v.toString()).isEmpty();
|
||||
if (v.type() == QVariant::String) {
|
||||
const QString tmp = expander->expand(v.toString());
|
||||
return !(tmp.isEmpty() || tmp == QLatin1String("false"));
|
||||
}
|
||||
return v.toBool();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user