mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Make bool option compatible with array input
This commit is contained in:
@@ -1804,14 +1804,23 @@ public:
|
|||||||
bool deserialize(const std::string &str, bool append = false) override
|
bool deserialize(const std::string &str, bool append = false) override
|
||||||
{
|
{
|
||||||
UNUSED(append);
|
UNUSED(append);
|
||||||
if (str == "1") {
|
|
||||||
this->value = true;
|
// Orca: take the first value if input is an array
|
||||||
return true;
|
std::istringstream is(str);
|
||||||
}
|
std::string item_str;
|
||||||
if (str == "0") {
|
if (std::getline(is, item_str, ',')) {
|
||||||
this->value = false;
|
boost::trim(item_str);
|
||||||
return true;
|
|
||||||
|
if (item_str == "1") {
|
||||||
|
this->value = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (item_str == "0") {
|
||||||
|
this->value = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user