ver, pos, fix-id, affect, nuit, readonly, visible, enabled, auto 新增属性如果为默认值,不写入JSON文本

This commit is contained in:
gb 2023-09-25 15:11:14 +08:00
parent 78bd8ba4c5
commit 5fc6f9f606
2 changed files with 11 additions and 5 deletions

View File

@ -262,13 +262,19 @@ known_file_util::IJsonW* CDlgOptJson::SANEOPT::to_json(void)
jsn->set_value(L"group", known_name::group_name(group.c_str()).c_str());
jsn->set_value(L"title", title.c_str());
jsn->set_value(L"desc", desc.c_str());
jsn->set_value(L"ver", ver);
jsn->set_value(L"pos", pos);
jsn->set_value(L"fix-id", fix_id);
jsn->set_value(L"type", type.c_str());
jsn->set_value(L"unit", unit.c_str());
if(ver > 0)
jsn->set_value(L"ver", ver);
if(pos > 0)
jsn->set_value(L"pos", pos);
if(fix_id > SANE_OPT_ID_BASE)
jsn->set_value(L"fix-id", fix_id);
SANEOPT::affect_str(nv, affect, false);
jsn->set_value(L"affect", nv);
if(nv)
jsn->set_value(L"affect", nv);
if(unit != L"none")
jsn->set_value(L"unit", unit.c_str());
if(readonly)
jsn->set_value(L"readonly", readonly);
if(open != OPT_VISIBLE_ALL)

Binary file not shown.