图像列表中存在图像时进行清空并启动扫描操作,弹窗提示重复;BUG-871

This commit is contained in:
yangjiaxuan 2023-12-25 11:55:43 +08:00
parent 1439c55d3c
commit 4f045fdc1a
1 changed files with 8 additions and 54 deletions

View File

@ -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;
}
}