fix(installer): add partition device existence check to handle physic…#119
Conversation
There was a problem hiding this comment.
Sorry @pppanghu77, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
…al USB removal - Add QFile::exists() check for partition device in QtBaseInstaller::checkError() before disk lookup to handle physical USB removal gracefully 修复(installer): 增加分区设备存在性检查以处理 USB 物理拔出场景 - 在 QtBaseInstaller::checkError() 中调用磁盘查找前增加 QFile::exists() 检查分区设备是否存在,优雅处理 USB 被物理拔出的情况 Log: 在安装器错误检查流程中增加分区设备存在性检查,防止 USB 被物理拔出后继续执行导致异常 Bug: https://pms.uniontech.com/bug-view-354921.html
deepin pr auto review你好!我是CodeGeeX,你的智能编程助手。我已经仔细审查了你提供的 Git Diff 输入。 本次代码修改主要包含两部分:一是更新了版权声明中的年份范围;二是在 整体来看,这个修改的逻辑方向是正确的,提前拦截了设备不存在的情况,避免了后续调用 1. 语法与逻辑
2. 代码质量
3. 代码性能
4. 代码安全
💡 改进后的代码建议综合以上意见,如果你希望快速改进当前代码,可以参考以下修改: qInfo() << "begin check error";
// Check if the partition device still exists (handles physical USB removal)
// 注意:建议后续重构将 m_strPartionName 修正为 m_strPartitionName
QFileInfo partionInfo(m_strPartionName);
if (!partionInfo.exists()) {
// 修正日志输出,使其更具可读性
qCritical() << "Device removed, causing USBMountFailed:" << m_strPartionName;
// 建议:确保 m_progressStatus 在此处处于合理的错误状态
emit progressfinished(m_progressStatus, BMHandler::ErrorType::USBMountFailed);
return;
}
QString strDisk = XSys::DiskUtil::GetPartitionDisk(m_strPartionName);
// ... 后续逻辑如果你有更多代码需要审查或讨论,随时告诉我! |
本次修改不涉及上述问题 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: max-lvs, pppanghu77 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
661051a
into
linuxdeepin:release/eagle
…al USB removal
修复(installer): 增加分区设备存在性检查以处理 USB 物理拔出场景
Log: 在安装器错误检查流程中增加分区设备存在性检查,防止 USB 被物理拔出后继续执行导致异常
Bug: https://pms.uniontech.com/bug-view-354921.html