From 776541ad7727404d96a39c8c32221b7831b6371b Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Sat, 17 Jun 2023 16:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=AE=BE=E7=BD=AE=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E6=97=B6=EF=BC=8C=E9=80=9A=E8=BF=87=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E6=B5=81=E7=A8=8B=E4=B8=AD=E8=BF=87=E6=BB=A4=E4=B8=8D?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgsane/sane_hg_mdw.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hgsane/sane_hg_mdw.cpp b/hgsane/sane_hg_mdw.cpp index 67ee5c5..afc16a2 100644 --- a/hgsane/sane_hg_mdw.cpp +++ b/hgsane/sane_hg_mdw.cpp @@ -532,7 +532,7 @@ hg_sane_middleware::hg_sane_middleware(void) : opt_0_(nullptr), init_ok_(false) if (lang_get_cur_code_page() != DEFAULT_CODE_PAGE) lang_refresh_language(); - // register_language_changed_notify(&hg_sane_middleware::language_changed, true); - called when reload_option + register_language_changed_notify(&hg_sane_middleware::language_changed, true); #if !defined(WIN32) && !defined(_WIN64) char path[512] = { 0 }; @@ -1977,7 +1977,8 @@ SANE_Status hg_sane_middleware::set_option(SANE_Handle h, const void* option, SA { VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "the setting '%s' affects other options value, RELOAD ...\n", desc_title.c_str()); //on_SCANNER_ERR_CONFIGURATION_CHANGED(dev); - reload_options(handle); + if(dev->fixed_id.count(SANE_OPT_ID_LANGUAGE) && dev->fixed_id[SANE_OPT_ID_LANGUAGE] != id) // language reload by callback already + reload_options(handle); err = (scanner_err)SANE_INFO_RELOAD_OPTIONS; } else if(err == SCANNER_ERR_RELOAD_IMAGE_PARAM) @@ -1989,7 +1990,8 @@ SANE_Status hg_sane_middleware::set_option(SANE_Handle h, const void* option, SA { VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "the setting '%s' affects image parameter and options, APP should re-get image info and reload options...\n", desc_title.c_str()); //on_SCANNER_ERR_CONFIGURATION_CHANGED(dev); - reload_options(handle); + if (dev->fixed_id.count(SANE_OPT_ID_LANGUAGE) && dev->fixed_id[SANE_OPT_ID_LANGUAGE] != id) // language reload by callback already + reload_options(handle); err = (scanner_err)(SANE_INFO_RELOAD_PARAMS | SANE_INFO_RELOAD_OPTIONS); } else if (err == SCANNER_ERR_ACCESS_DENIED)