-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Adjust CPU frequency for kSpecialType5 device #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Modified CPU frequency display for kSpecialType5 devices include current frequency and max frequency to correct hardware reporting inaccuracies. Log: Fix CPU frequency display for special device type Task: https://pms.uniontech.com/task-view-381921.html Change-Id: Ia80c7e9edf7618188874e0648cb599920f49eada
deepin pr auto review根据提供的代码差异,我来进行分析和提出改进建议:
具体改进建议: // 在 DeviceCpu.cpp 中
void DeviceCpu::setCpuInfo(const QMap<QString, QString> &mapLscpu, const QMap<QString, QString> &mapCpuinfo) {
// ... 其他代码 ...
// 特殊处理特定型号的CPU频率显示
if (Common::specialComType == Common::kSpecialType5 ||
Common::specialComType == Common::kSpecialType6) {
// 定义常量
static const QLatin1String oldFreq("2.189");
static const QLatin1String newFreq("2.188");
static const QLatin1String oldMaxFreq("2189");
static const QLatin1String newMaxFreq("2188");
// 安全地进行字符串替换
if (m_Frequency.contains(oldFreq)) {
m_Frequency.replace(oldFreq, newFreq);
}
if (m_MaxFrequency.contains(oldMaxFreq)) {
m_MaxFrequency.replace(oldMaxFreq, newMaxFreq);
}
}
}
// 在 commonfunction.h 中
class Common {
// ... 其他代码 ...
enum SpecialType {
// ... 其他枚举值 ...
kSpecialType5, // 之前是 PGUX
kSpecialType6,
kSpecialType7,
kCustomType
};
// ... 其他代码 ...
};这些改进将使代码更加健壮、可维护,并提高其性能和安全性。 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adds kSpecialType5 support for CPU frequency correction alongside existing specialType6 logic and renames the PGUX enum to kSpecialType5 in common functions for consistent device categorization. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, max-lvs 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 |
|
/merge |
Modified CPU frequency display for kSpecialType5 devices include current frequency and max frequency to correct hardware reporting inaccuracies.
Log: Fix CPU frequency display for special device type
Task: https://pms.uniontech.com/task-view-381921.html
Change-Id: Ia80c7e9edf7618188874e0648cb599920f49eada
Summary by Sourcery
Include support for kSpecialType5 devices in CPU frequency reporting and unify enum naming for better consistency.
Enhancements: