分支合一,部分v20修改pick及Qt5编译兼容#101
Merged
deepin-bot[bot] merged 3 commits intolinuxdeepin:masterfrom Dec 18, 2025
Merged
Conversation
bash command hardening Log: bash command hardening Task: https://pms.uniontech.com/task-view-362031.html
- Add automatic partition creation for unpartitioned USB disks using fdisk - Optimize df command to exclude network filesystems (NFS, CIFS, SMBFS, SSHFS, FTPFS, DAVFS) - Improve device scanning logic to skip network-related devices Log: Enable creating bootable USB drives from unpartitioned USB disks and improve disk querying efficiency Bug: https://pms.uniontech.com/bug-view-338629.html
- Add conditional compilation for dtk6core/dtkcore in libdbm and service - Add conditional compilation for polkit-qt6-1/polkit-qt5-1 in service - Add Qt5 compatible QString::SkipEmptyParts for Qt < 5.14 - Add DApplicationSettings header include for Qt5 - Add Dtk::Gui namespace for Qt5 DGuiApplicationHelper usage Log: Enable project to compile with both Qt5 and Qt6 environments
deepin pr auto review我来对这个diff进行详细的代码审查:
建议改进:
// 在CreatePartition函数中建议增加更详细的错误处理
if (!result.isSuccess()) {
qWarning() << "Failed to create partition table with fdisk for" << diskDev;
qWarning() << "Error output:" << result.result(); // 添加错误输出
return false;
}
// 在CommandLsblkParse函数中建议使用QScopedPointer管理资源
QScopedPointer<QProcess> lsblk(new QProcess);
lsblk->start("lsblk", QStringList{"-b", "-p", "-P", "-o", "name,label,size,uuid,fstype,type"});
// 建议将设备过滤逻辑抽取为单独的函数
bool isValidDevice(const QString& fileName) {
return fileName.contains(QRegularExpression("^usb-\\S{1,}$")) ||
fileName.contains(QRegularExpression("^mmc-\\S{1,}$"));
}
// 在ListUsbDrives函数中建议使用QHash替代QMap以提高查找性能
QHash<QString, DeviceInfo> dfDeviceInfos = CommandDfParse();
// 在处理设备路径时建议增加路径验证
bool isValidDevicePath(const QString& path) {
QRegularExpression re("^/dev/[a-zA-Z0-9]+$");
return re.match(path).hasMatch();
}
// 建议统一命名风格,如m_strPartionName改为m_partitionName
QString partitionName; // 替代 m_strPartionName
/**
* @brief CreatePartition 创建磁盘分区
* @param diskDev 磁盘设备路径,如"/dev/sdb"
* @return 成功返回true,失败返回false
* @note 仅支持Linux系统
*/
bool CreatePartition(const QString& diskDev);这些改进将使代码更加健壮、安全和可维护。总体来说,这个diff的改进是积极的,特别是在兼容性和设备处理逻辑方面。 |
lzwind
approved these changes
Dec 17, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: itsXuSt, lzwind 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 |
Contributor
Author
|
/merge |
Contributor
|
This pr cannot be merged! (status: unstable) |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please do not send pull requests to the linuxdeepin/*
see https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers
Thanks!
Summary by Sourcery
Improve USB drive handling and add Qt5 build compatibility across the project.
New Features:
Bug Fixes:
Enhancements:
Build: