From 9d275d6d345b9aacb87daab9d01c0922206288d1 Mon Sep 17 00:00:00 2001 From: Nick Tiskov Date: Wed, 27 Feb 2013 13:13:00 +0400 Subject: [PATCH] Allow bool lists in json values --- src/webui/json.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webui/json.cpp b/src/webui/json.cpp index e0cdef964..5077bb0e2 100644 --- a/src/webui/json.cpp +++ b/src/webui/json.cpp @@ -133,7 +133,12 @@ QVariantMap json::fromJson(const QString& json) { if (list_val.startsWith("\"") && list_val.endsWith("\"")) { varlist << list_val.mid(1, list_val.length()-2).replace("\\n", "\n"); } else { - varlist << list_val.toInt(); + if (list_val.compare(("false"), Qt::CaseInsensitive) == 0) + varlist << false; + else if (list_val.compare(("true"), Qt::CaseInsensitive) == 0) + varlist << true; + else + varlist << list_val.toInt(); } } value = varlist;