From 4f045fdc1a033b74d7224f31802dbfc84168e910 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 25 Dec 2023 11:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E5=83=8F=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=9B=BE=E5=83=8F=E6=97=B6=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E5=B9=B6=E5=90=AF=E5=8A=A8=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=EF=BC=8C=E5=BC=B9=E7=AA=97=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=87=8D=E5=A4=8D;BUG-871?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner2/mainwindow.cpp | 62 +++++-------------------------------- 1 file changed, 8 insertions(+), 54 deletions(-) diff --git a/app/scanner2/mainwindow.cpp b/app/scanner2/mainwindow.cpp index 63708501..8848dd68 100644 --- a/app/scanner2/mainwindow.cpp +++ b/app/scanner2/mainwindow.cpp @@ -1935,7 +1935,13 @@ askIfClear MainWindow::startScanMessageBox(QWidget *parent) return cancelScan; else if (box.clickedButton() == clearBtn) { - on_act_closeAll_triggered(); + auto_save_info_.index = 0; + auto_save_info_.path = ""; + + startSaveMessageBox(this); + m_thumb->removeAllItems(HGImgThumb::ThumbRemoveFlag_NULL); + m_curBatchFileList.clear(); + return clearAndScan; } return notClearAndScan; @@ -4309,56 +4315,6 @@ void MainWindow::ocrMsgPumpFunc(HGMsgPump msgPump, const HGMsg *msg, HGPointer p { QString *filePath = (QString *)msg->data; -#if 0 - HGChar moduleName[256]; - HGBase_GetModuleName(nullptr, moduleName, 256); - HGChar curPath2[256]; - HGBase_GetFilePath(moduleName, curPath2, 256); - QString curPath(curPath2); - - QProcess proc; - QStringList argList; - argList.push_back(QString("-filePath=%1").arg(*filePath)); - -#if defined(HG_CMP_MSC) - #if defined(OEM_HANWANG) - proc.startDetached(curPath + "HwOCR.exe", argList); - #elif defined(OEM_LISICHENG) - proc.startDetached(curPath + "LscOCR.exe", argList); - #elif defined(OEM_CANGTIAN) - proc.startDetached(curPath + "CtsOCR.exe", argList); - #elif defined(OEM_ZHONGJING) - proc.startDetached(curPath + "ZjOCR.exe", argList); - #elif defined(OEM_ZIGUANG) - proc.startDetached(curPath + "ZgOCR.exe", argList); - #elif defined(OEM_NEUTRAL) - proc.startDetached(curPath + "NeuOCR.exe", argList); - #elif defined(OEM_DELI) - proc.startDetached(curPath + "DlOCR.exe", argList); - #else - proc.startDetached(curPath + "HGOCR.exe", argList); - #endif -#else - #if defined(OEM_HANWANG) - proc.startDetached(curPath + "HwOCR", argList); - #elif defined(OEM_LISICHENG) - proc.startDetached(curPath + "LscOCR", argList); - #elif defined(OEM_CANGTIAN) - proc.startDetached(curPath + "CtsOCR", argList); - #elif defined(OEM_ZHONGJING) - proc.startDetached(curPath + "ZjOCR", argList); - #elif defined(OEM_ZIGUANG) - proc.startDetached(curPath + "ZgOCR", argList); - #elif defined(OEM_NEUTRAL) - proc.startDetached(curPath + "NeuOCR", argList); - #elif defined(OEM_DELI) - proc.startDetached(curPath + "DlOCR", argList); - #else - proc.startDetached(curPath + "HGOCR", argList); - #endif -#endif - -#else HGOCRMgr ocrMgr = NULL; HGImgProc_CreateOCRMgr(HGIMGPROC_OCRALGO_DEFAULT, &ocrMgr); if (NULL != ocrMgr) @@ -4383,14 +4339,12 @@ void MainWindow::ocrMsgPumpFunc(HGMsgPump msgPump, const HGMsg *msg, HGPointer p HGImgFmt_CloseImageReader(reader); } - HGBase_DeleteFile(filePath->toLocal8Bit().toStdString().c_str()); + //HGBase_DeleteFile(filePath->toLocal8Bit().toStdString().c_str()); HGImgProc_ImageListOCRToFile(ocrMgr, 0, filePath->toLocal8Bit().toStdString().c_str(), NULL, NULL); HGImgProc_DestroyOCRMgr(ocrMgr); } -#endif - delete filePath; } }