!12 修复概率性出现的 U 盘插入不弹窗问题

Merge pull request !12 from openkylin/yangtze
This commit is contained in:
tiantian 2024-04-01 02:06:01 +00:00 committed by Gitee
commit 8f194efdff
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 3 deletions

View File

@ -129,7 +129,9 @@ void MainWindow::initFlashDisk()
// init the screen
screen = qApp->primaryScreen();
m_nAppStartTimestamp = QDateTime::currentDateTime().toMSecsSinceEpoch();
QTimer::singleShot(NEWINFO_DELAYSHOW_TIME, [this] {
m_bIsJustStarted = false;
});
m_dataFlashDisk = FlashDiskData::getInstance();
}
@ -761,10 +763,11 @@ void MainWindow::getDeviceInfo()
void MainWindow::onConvertShowWindow(QString strDriveId, QString strMountUri)
{
// 进程启动时一定时间内不弹窗提示
if (QDateTime::currentDateTime().toMSecsSinceEpoch() - m_nAppStartTimestamp < NEWINFO_DELAYSHOW_TIME) {
if (m_bIsJustStarted) {
m_dataFlashDisk->resetAllNewState();
return;
}
insertorclick = true;
qDebug()<<"--------the frist insert--MainWindowShow----------";

View File

@ -123,7 +123,7 @@ private:
FlashDiskData* m_dataFlashDisk = nullptr;
bool m_bIsMouseInTraIcon = false;
bool m_bIsMouseInCentral = false;
qint64 m_nAppStartTimestamp = 0; // 进程启动时的时间戳
bool m_bIsJustStarted = true;
QString m_strSysRootDev;
QMap<QString, FDFrame *> centralWidgetList;
baseWidget * m_basewidget;