修复加载配置文件BUG

This commit is contained in:
gb 2022-10-08 17:31:13 +08:00
parent 970db48e17
commit b44dd6940c
1 changed files with 4 additions and 3 deletions

View File

@ -469,13 +469,14 @@ int scanner::open(void)
ret = hg_sane_middleware::instance()->open_device(name.c_str(), &handle_);
if (ret == SANE_STATUS_GOOD)
{
size_t pid = scanner_name_.find(L" - ");
if (pid == -1)
pid = scanner_name_.length();
size_t pid = -1;
transport_config_file();
callback::reg_callback(handle_, this);
scanner_name_ = local_trans::a2u(name.c_str(), CP_UTF8);
pid = scanner_name_.find(L" - ");
if (pid == -1)
pid = scanner_name_.length();
ret = init_options_id();
load_config((cfg_path_ + scanner_name_.substr(0, pid) + L".cfg").c_str());
apply_config();