按键扫描工具首次打开服务延时改为15秒,解决进程占用问题;BUG-1251

This commit is contained in:
yangjiaxuan 2024-09-02 15:50:35 +08:00
parent bdc738ea62
commit b63d5d9ff5
2 changed files with 14 additions and 1 deletions

View File

@ -25,6 +25,7 @@ MainWindow::MainWindow(QWidget *parent)
, m_dlgScanInfo(nullptr) , m_dlgScanInfo(nullptr)
, m_devHandle(nullptr) , m_devHandle(nullptr)
, m_scanning(false) , m_scanning(false)
, m_isFirstConnectServer(false)
, m_dpi(200) , m_dpi(200)
, m_scanFileName("") , m_scanFileName("")
, m_scanImgFmtWriter(nullptr) , m_scanImgFmtWriter(nullptr)
@ -1262,6 +1263,10 @@ void MainWindow::timerEvent(QTimerEvent *e)
this->killTimer(m_timerId); this->killTimer(m_timerId);
m_timerId = -1; m_timerId = -1;
} }
else
{
m_timerId = this->startTimer(5000);
}
} }
} }
@ -1441,7 +1446,14 @@ void MainWindow::on_saneEventCloseDevice(void* devHandle, bool isOnline)
} }
if (isOnline) if (isOnline)
m_timerId = this->startTimer(5000); {
int time = 5000;
if (m_isFirstConnectServer)
time = 15000;
m_timerId = this->startTimer(time);
m_isFirstConnectServer = false;
}
} }
void MainWindow:: on_pushButtonAdd_clicked() void MainWindow:: on_pushButtonAdd_clicked()

View File

@ -93,6 +93,7 @@ private:
QString m_devName; QString m_devName;
SANE_Handle m_devHandle; SANE_Handle m_devHandle;
bool m_scanning; bool m_scanning;
bool m_isFirstConnectServer;
HGUInt m_dpi; HGUInt m_dpi;
QString m_scanFileName; QString m_scanFileName;