mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-13 21:02:34 +08:00
fix: #256 non-string properties weren't supported
This commit is contained in:
parent
7a4324b2ff
commit
f71136fd46
@ -13,7 +13,7 @@ CPropertyCombo* CPropertyCombo::fromJSON (json data, const std::string& name) {
|
|||||||
const auto text = jsonFindDefault<std::string> (data, "text", "");
|
const auto text = jsonFindDefault<std::string> (data, "text", "");
|
||||||
const auto options = jsonFindRequired (data, "options", "Options for a property combo is required");
|
const auto options = jsonFindRequired (data, "options", "Options for a property combo is required");
|
||||||
|
|
||||||
auto* combo = new CPropertyCombo (name, text, *value);
|
auto* combo = new CPropertyCombo (name, text, value->dump ());
|
||||||
|
|
||||||
if (!options->is_array ())
|
if (!options->is_array ())
|
||||||
sLog.exception ("Property combo options should be an array");
|
sLog.exception ("Property combo options should be an array");
|
||||||
@ -27,7 +27,7 @@ CPropertyCombo* CPropertyCombo::fromJSON (json data, const std::string& name) {
|
|||||||
auto label = jsonFindRequired (cur, "label", "Label is required for a property combo option");
|
auto label = jsonFindRequired (cur, "label", "Label is required for a property combo option");
|
||||||
auto propertyValue = jsonFindRequired (cur, "value", "Value is required for a property combo option");
|
auto propertyValue = jsonFindRequired (cur, "value", "Value is required for a property combo option");
|
||||||
|
|
||||||
combo->addValue (*label, *propertyValue);
|
combo->addValue (*label, propertyValue->dump());
|
||||||
}
|
}
|
||||||
|
|
||||||
return combo;
|
return combo;
|
||||||
|
Loading…
Reference in New Issue
Block a user