Conversation
1. Added new DVDRwFormatEngine class to handle DVD RW erasure using dvd+rw-tools 2. Modified control files to add dvd+rw-tools as a dependency 3. Updated DOpticalDiscManager to detect DVD±RW media and use new engine when available 4. Implemented progress parsing for dvd+rw-format's special output format 5. Added fallback to xorriso when dvd+rw-format is not available Log: Added support for DVD±RW erasure using dvd+rw-format tool Influence: 1. Test DVD+RW and DVD-RW erasure with dvd+rw-tools installed 2. Verify fallback to xorriso when dvd+rw-tools is missing 3. Check progress reporting during erase operations 4. Test with different DVD RW media types 5. Verify no regression in CD/DVD non-RW erase functionality feat: 添加对DVD RW擦除的dvd+rw-format支持 1. 新增DVDRwFormatEngine类用于通过dvd+rw-tools处理DVD RW擦除 2. 修改控制文件添加dvd+rw-tools作为依赖项 3. 更新DOpticalDiscManager以检测DVD±RW介质并在可用时使用新引擎 4. 实现针对dvd+rw-format特殊输出格式的进度解析 5. 添加当dvd+rw-format不可用时回退到xorriso的处理 Log: 新增使用dvd+rw-format工具进行DVD±RW擦除的支持 Influence: 1. 测试dvd+rw-tools安装时的DVD+RW和DVD-RW擦除功能 2. 验证dvd+rw-tools缺失时回退到xorriso的功能 3. 检查擦除过程中的进度报告 4. 使用不同类型的DVD RW介质进行测试 5. 验证普通CD/DVD非RW擦除功能无回归
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liyigang1 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 |
Reviewer's GuideDVD±RW erasure now uses a dedicated dvd+rw-format process with media-specific operations and aggregated progress reporting, while retaining xorriso as a fallback and packaging the required utility dependency. Sequence diagram for dvd+rw-format DVD±RW erasuresequenceDiagram
participant M as DOpticalDiscManager
participant E as DVDRwFormatEngine
participant P as dvd+rw-format
M->>M: createOpticalInfo
M->>E: doErase(device, mediaType)
E->>P: start(args)
loop Poll process output
E->>P: waitForReadyRead
P-->>E: progress output
E->>E: parseProgress
E-->>M: jobStatusChanged(status, progress)
end
P-->>E: exit code
E-->>M: jobStatusChanged(kFinished, 100)
Flow diagram for DVD±RW erase engine selectionflowchart TD
A[DOpticalDiscManager::erase] --> B[createOpticalInfo]
B --> C{DVD±RW media?}
C -->|No| D[DXorrisoEngine]
C -->|Yes| E{dvd+rw-format available?}
E -->|No| D
E -->|Yes| F[DVDRwFormatEngine::doErase]
F --> G[Erase with dvd+rw-format]
D --> H[xorriso erase]
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 found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/dfm-burn/dfm-burn-lib/private/dvdrwformatengine.cpp" line_range="31-32" />
<code_context>
+
+ // 1. 校验设备路径
+ QString cleanDev = QDir::cleanPath(dev);
+ if (!cleanDev.startsWith("/dev/sr")) {
+ qWarning() << "[dfm-burn] Invalid device path:" << dev;
+ Q_EMIT jobStatusChanged(JobStatus::kFailed, -1);
+ return false;
</code_context>
<issue_to_address>
**issue (bug_risk):** `doErase` rejects valid optical-drive symlink paths such as `/dev/dvd` and `/dev/cdrom` because it requires the cleaned path to start with `/dev/sr`, so DVD±RW erase fails instead of invoking `dvd+rw-format`.
**Triggers:** When DOpticalDiscManager is constructed with a standard `/dev/dvd` or `/dev/cdrom` symlink.
**Suggested fix:** Validate the resolved device with `QFileInfo::canonicalFilePath()` or accept supported optical-drive symlinks rather than requiring the `/dev/sr*` spelling.
</issue_to_address>| if (!cleanDev.startsWith("/dev/sr")) { | ||
| qWarning() << "[dfm-burn] Invalid device path:" << dev; |
There was a problem hiding this comment.
issue (bug_risk): doErase rejects valid optical-drive symlink paths such as /dev/dvd and /dev/cdrom because it requires the cleaned path to start with /dev/sr, so DVD±RW erase fails instead of invoking dvd+rw-format.
Triggers: When DOpticalDiscManager is constructed with a standard /dev/dvd or /dev/cdrom symlink.
Suggested fix: Validate the resolved device with QFileInfo::canonicalFilePath() or accept supported optical-drive symlinks rather than requiring the /dev/sr* spelling.
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰,边界处理完善。erase() 方法正确查询介质类型、检查 dvd+rw-format 可用性并降级到 xorriso;doErase() 正确验证设备路径、选择命令参数、轮询进程输出、解析进度并处理退出码。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 代码结构清晰,注释完整。注释详细解释了 dvd+rw-format 的进度输出机制、SCSI 操作阶段和 waitForReadyRead 的选用原因。建议将设备路径校验改为更精确的正则匹配。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理。使用 static const QRegularExpression 避免重复编译;缓冲区大小限制在 1024 字节防止无限增长;200ms 轮询间隔合理;waitForReadyRead 内部调用 processEvents 确保信号实时传递。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞,安全合规。QProcess::start() 使用 QStringList 参数避免命令注入;QDir::cleanPath() 规范化路径并前缀校验防止路径遍历;QStandardPaths::findExecutable() 安全查找二进制;设备路径和介质类型均做了输入校验。 💡 改进建议代码示例// 更精确的设备路径校验
static const QRegularExpression devPattern("^/dev/sr[0-9]+$");
if (!devPattern.match(cleanDev).hasMatch()) {
qWarning() << "[dfm-burn] Invalid device path:" << dev;
Q_EMIT jobStatusChanged(JobStatus::kFailed, -1);
return false;
}本报告由 AI 代码审查工具自动生成 |
|
返工撤销:负责人审核要求撤销 develop/eagle 分支提交,此 PR 关闭。 |
修复内容
PMS bug 276977:DVD±RW 擦除失败——
DOpticalDiscManager::erase()仅使用 xorriso,部分 DVD±RW 介质擦除失败。源修复 commit
236f0d4(master 分支)新增DVDRwFormatEngine,使用dvd+rw-format进行 DVD±RW 分流擦除,xorriso 作为降级方案。改动文件
src/dfm-burn/dfm-burn-lib/private/dvdrwformatengine.h— DVDRwFormatEngine 头文件src/dfm-burn/dfm-burn-lib/private/dvdrwformatengine.cpp— DVDRwFormatEngine 实现src/dfm-burn/dfm-burn-lib/dopticaldiscmanager.cpp— erase() 中调用 DVDRwFormatEnginedebian/control— libdfm-burn Depends 添加 dvd+rw-tools验证
236f0d4,已解决分支差异冲突DOpticalDiscManager::erase(),无需修改 dde-file-managerSummary by Sourcery
Enable reliable DVD±RW disc erasure through dvd+rw-format with xorriso fallback.
New Features:
Bug Fixes:
Build: