Revert "fix: Fix fail to format disk to FAT32"#196
Revert "fix: Fix fail to format disk to FAT32"#196deepin-bot[bot] merged 1 commit intolinuxdeepin:release/1071from
Conversation
This reverts commit db3d1ce. Bug: https://pms.uniontech.com/bug-view-352827.html
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRe-enables FAT32 filesystem support by instantiating a FAT16 handler for FAT32 entries instead of leaving them commented out, effectively reverting a previous change that disabled FAT32 formatting. Sequence diagram for FAT32 format request using FAT16 handlersequenceDiagram
actor User
participant UI
participant DiskService
participant SupportedFileSystems
participant FAT16
User ->> UI: requestFormat(device, FS_FAT32)
UI ->> DiskService: format(device, FS_FAT32)
DiskService ->> SupportedFileSystems: getFileSystem(FSType FS_FAT32)
SupportedFileSystems -->> DiskService: FAT16 instance
DiskService ->> FAT16: format(device)
FAT16 -->> DiskService: formatResult
DiskService -->> UI: formatResult
UI -->> User: showFormatResult
Updated class diagram for SupportedFileSystems FAT32 mappingclassDiagram
class SupportedFileSystems {
- map<FSType, FileSystem*> m_fsObjects
+ SupportedFileSystems()
+ FileSystem* getFileSystem(FSType type)
}
class FileSystem {
<<interface>>
+ format(Device device)
+ mount(Device device)
}
class EXT2 {
+ EXT2(FSType type)
}
class FAT16 {
+ FAT16(FSType type)
}
FileSystem <|.. EXT2
FileSystem <|.. FAT16
SupportedFileSystems --> FileSystem : manages_filesystems
SupportedFileSystems --> FAT16 : FS_FAT16_and_FS_FAT32_entries
SupportedFileSystems --> EXT2 : FS_EXT2_FS_EXT3_FS_EXT4_entries
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Since
FS_FAT32is being handled by theFAT16class, consider adding a brief comment explaining this design choice to avoid future confusion or accidental reversion of this line.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since `FS_FAT32` is being handled by the `FAT16` class, consider adding a brief comment explaining this design choice to avoid future confusion or accidental reversion of this line.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review代码审查意见1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议代码示例假设 // 使用 enum class 增强类型安全
enum class FsType { EXT4, FAT32, ... };
// 使用智能指针管理资源
std::map<FsType, std::unique_ptr<FileSystemBase>> m_fsObjects;
SupportedFileSystems::SupportedFileSystems()
{
// 使用 std::make_unique 并处理可能的异常(如果需要)
m_fsObjects[FsType::EXT4] = std::make_unique<EXT2>(FsType::EXT4);
// 针对 FAT32,建议确认是否有专门的 FAT32 类
// 如果 FAT16 类确实兼容 FAT32,请确保文档说明清晰
m_fsObjects[FsType::FAT32] = std::make_unique<FAT16>(FsType::FAT32);
// ...
}总结主要关注点在于 |
|
[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) |
b84073d
into
linuxdeepin:release/1071
This reverts commit db3d1ce.
Bug: https://pms.uniontech.com/bug-view-352827.html
Summary by Sourcery
Bug Fixes: