feat: Adjust CPU frequency for kSpecialType5 device#534
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom Sep 15, 2025
Merged
feat: Adjust CPU frequency for kSpecialType5 device#534deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom
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
|
max-lvs
approved these changes
Sep 15, 2025
|
[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 |
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.
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: