只读属性默认为false;可见属性默认为true;可用属性默认为true。该三个属性如果是默认值,不写在JSON中
This commit is contained in:
parent
d5a3f5c553
commit
9a2ff90875
|
@ -268,8 +268,11 @@ known_file_util::IJsonW* CDlgOptJson::SANEOPT::to_json(void)
|
|||
jsn->set_value(L"unit", unit.c_str());
|
||||
SANEOPT::affect_str(nv, affect, false);
|
||||
jsn->set_value(L"affect", nv);
|
||||
if(readonly)
|
||||
jsn->set_value(L"readonly", readonly);
|
||||
if(!open)
|
||||
jsn->set_value(L"visible", open);
|
||||
if(!enable)
|
||||
jsn->set_value(L"enabled", enable);
|
||||
jsn->set_value(L"size", (int)sizeof(int));
|
||||
if (!auto_restore_default)
|
||||
|
@ -740,8 +743,10 @@ bool CDlgOptJson::SANEOPT::from_json(known_file_util::IJsonW* jsn)
|
|||
SANEOPT::affect_str(ver, affect, true);
|
||||
jsn->get_value(L"ver", ver);
|
||||
jsn->get_value(L"pos", pos);
|
||||
jsn->get_value(L"readonly", readonly);
|
||||
jsn->get_value(L"visible", open);
|
||||
if (!jsn->get_value(L"readonly", readonly))
|
||||
readonly = false;
|
||||
if (!jsn->get_value(L"visible", open))
|
||||
open = true;
|
||||
if (!jsn->get_value(L"enabled", enable))
|
||||
enable = true;
|
||||
if (!jsn->get_value(L"fix-id", fix_id) && !name.empty())
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue