From bdb975bdfbaab50792c88525995773c56475bcbf Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 21 Aug 2023 18:27:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E4=BA=A7=E7=B3=BB=E7=BB=9Fsystem?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=89=93=E5=BC=80pdf=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=8A=A0=E7=89=B9=E5=AE=9A=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 291631f..9de6f98 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -1,4 +1,4 @@ -#include "hg_scanner.h" +#include "hg_scanner.h" #include "../wrapper/hg_log.h" #include "sane/sane_option_definitions.h" #include "scanner_setting.h" @@ -1657,8 +1657,11 @@ int hg_scanner::setting_help(void* data, long* len) { std::string helpfile = get_help_file_path(); + std::string com = "xdg-open ";//注意空格保留 + int ret = SCANNER_ERR_OK; #if defined(WIN32) || defined(_WIN64) + com = ""; FILE* src = fopen(helpfile.c_str(), "rb"); if (src) fclose(src); @@ -1672,10 +1675,12 @@ int hg_scanner::setting_help(void* data, long* len) return ret ; } + com += helpfile; + #if defined(WIN32) || defined(_WIN64) - ShellExecuteA(NULL, "Open", helpfile.c_str(), NULL, NULL, SW_SHOWNORMAL); + ShellExecuteA(NULL, "Open", com.c_str(), NULL, NULL, SW_SHOWNORMAL); #else - system(helpfile.c_str()); + system(com.c_str()); #endif VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO,"scanSettings_Help_pdf Path is:%s %d\r\n",helpfile.c_str(), 1); return ret;