-
Notifications
You must be signed in to change notification settings - Fork 143
fix(systeminfo): fix processorChanged signal emission and processor setting location #2980
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts how the processorChanged signal is emitted and clarifies where the processor field is set to avoid duplicate updates in the system info plugin. Sequence diagram for updated processorChanged emission and processor setting flowsequenceDiagram
actor User
participant SystemInfoPluginUI
participant SystemInfoWork
participant SystemInfoModel
User ->> SystemInfoPluginUI: openSystemInfoAboutPage
SystemInfoPluginUI ->> SystemInfoWork: createInstance
activate SystemInfoWork
SystemInfoWork ->> SystemInfoModel: constructor
SystemInfoModel ->> SystemInfoModel: updateFrequency
SystemInfoModel ->> SystemInfoModel: setProcessor(processor)
SystemInfoModel ->> SystemInfoModel: Q_EMIT processorChanged(processor)
SystemInfoModel -->> SystemInfoPluginUI: processorChanged(processor)
deactivate SystemInfoWork
User ->> SystemInfoPluginUI: refreshSystemInfo
SystemInfoPluginUI ->> SystemInfoWork: activate
SystemInfoWork ->> SystemInfoModel: setType(QSysInfo_WordSize)
SystemInfoWork ->> SystemInfoModel: setKernel(kernelVersion)
Note over SystemInfoWork,SystemInfoModel: processor is not set in activate to avoid duplicate processorChanged
SystemInfoModel -->> SystemInfoPluginUI: existing processor value used for display
Class diagram for SystemInfoModel and SystemInfoWork processor handling changesclassDiagram
class SystemInfoModel {
- QString m_processor
+ SystemInfoModel()
+ void setProcessor(QString processor)
+ void setType(int wordSize)
+ void setKernel(QString kernelVersion)
+ void updateFrequency()
+ void processorChanged(QString processor)
}
class SystemInfoWork {
- SystemInfoModel* m_model
+ SystemInfoWork()
+ void activate()
}
SystemInfoWork --> SystemInfoModel : uses
SystemInfoModel ..> SystemInfoModel : Q_EMIT processorChanged
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.
Hey - I've left some high level feedback:
- Relying on processor initialization inside the constructor’s updateFrequency() is a bit implicit; consider either moving the processor setup into a clearly named initialization method or expanding the comment to briefly mention where processor is set to make the control flow easier to follow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Relying on processor initialization inside the constructor’s updateFrequency() is a bit implicit; consider either moving the processor setup into a clearly named initialization method or expanding the comment to briefly mention where processor is set to make the control flow easier to follow.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
setting location - Changed processorChanged call to explicitly emit signal using Q_EMIT processorChanged - Added comments explaining that processor is not set in activate to avoid duplicate settings --- fix(systeminfo): 修复 processorChanged 信号发射和 processor 设置位置 - 将 processorChanged 调用改为显式发射信号 Q_EMIT processorChanged - 注释说明不在 activate 中设置 processor,避免重复设置 Bug: https://pms.uniontech.com/bug-view-274991.html PMS: BUG-274991 Influence: 控制中心->系统->关于本机->处理器
3b6c708 to
e1e41f8
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: electricface, fly602 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
deepin pr auto review这段代码的修改主要涉及Qt信号/槽机制的规范使用以及业务逻辑的调整。以下是对代码变更的审查意见: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段代码修改整体是积极的,提升了代码规范性和性能。针对
|
Q_EMIT processorChanged
to avoid duplicate settings
fix(systeminfo): 修复 processorChanged 信号发射和 processor
设置位置
processorChanged
PMS: BUG-274991
Influence: 控制中心->系统->关于本机->处理器
Summary by Sourcery
Fix processor change handling in the system info plugin to ensure correct signal emission and avoid duplicate processor updates.
Bug Fixes: