pick develop/eagle to master #561
Merged
Merged
Conversation
fix the get info from edit in order read the edid info from system may not in order. Log: fix the get info from edit in order Bug: https://pms.uniontech.com/bug-view-305295.html Change-Id: I5c124f5fd431b1e4a78eaeacd5c748b5fee0c6e7
fix the monitor info in single screen mode. pick from: linuxdeepin@ed89899 Log: fix the monitor info in single screen mode. Bug: https://pms.uniontech.com/bug-view-305295.html
fix get the storage size info from smartctl pick from: linuxdeepin@899d8b4 Log: fix get the storage size info from smartctl. Bug: https://pms.uniontech.com/bug-view-312479.html Change-Id: I5ee5e270c0d5170d4c950d82bf028a0c6023693f
fix the monitor display info in special machine pick-from: linuxdeepin@9a46594 Log: fix the monitor display info in special machine Bug: https://pms.uniontech.com/bug-view-310413.html
deepin pr auto review我来对这段代码进行审查,主要关注以下几个方面:
分析如下:
具体修改建议:
bool DeviceMonitor::setInfoFromXradr(const QString &main, const QString &edid, const QString &name)
{
// 参数验证
if (main.isEmpty() || edid.isEmpty() || name.isEmpty()) {
return false;
}
// Display Input 检查
for(const auto& info : m_LstBaseInfo) {
if (info.first.contains("Display Input")) {
if (!main.contains(info.second, Qt::CaseInsensitive)) {
return false;
}
}
}
// 其余逻辑...
}
// 在工具类中添加
QString formatResolution(const QString& resolution) {
return resolution.replace("x", "×", Qt::CaseInsensitive);
}
// 使用时
m_CurrentResolution = formatResolution(QString("%1@%2").arg(match.captured(1)).arg(curRate));
bool DeviceStorage::compareSize(const QString &size1, const QString &size2)
{
double num1 = 0;
double num2 = 0;
QRegularExpression reg(".*\\[(\\d+\\.?\\d+).*\\]");
if (reg.match(size1).hasMatch()) {
num1 = reg.match(size1).captured(1).toDouble();
}
if (reg.match(size2).hasMatch()) {
num2 = reg.match(size2).captured(1).toDouble();
}
return qFuzzyCompare(num1, num2) ? size2 : (num1 > num2 ? size1 : size2);
}
void HWGenerator::generatorMonitorDevice()
{
QDir toDir(toPath_);
if (!toDir.exists()) {
return;
}
QDirIterator it(toPath_, QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
QFileInfo fileInfo = it.nextFileInfo();
if (!fileInfo.fileName().startsWith("card")) {
continue;
}
// 处理文件...
}
}
namespace DeviceConstants {
enum SpecialComputerType {
NormalCom = 5,
SpecialCom = 6
};
}这些改进可以提高代码的可维护性、性能和安全性。建议在实施这些更改时进行充分的测试,确保不会影响现有功能。 |
lzwind
approved these changes
Nov 28, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, 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 |
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.
pick develop/eagle to master