Fix: The screen size show error.#628
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Mar 30, 2026
Merged
Conversation
-- Add Group Policy item to control whether to display screen size. Log: fix issue Bug: https://pms.uniontech.com/bug-view-354275.html
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a configurable option (via DConfig Group Policy) to control whether the monitor screen size is displayed in the device manager, and updates the file copyright years. Sequence diagram for conditional display of monitor screen sizesequenceDiagram
participant DeviceMonitor
participant DConfig
DeviceMonitor->>DeviceMonitor: loadOtherDeviceInfo()
DeviceMonitor->>DeviceMonitor: addOtherDeviceInfo(Primary_Monitor, m_MainScreen)
DeviceMonitor->>DeviceMonitor: showScreenSize = true
alt DConfig_available
DeviceMonitor->>DConfig: create(org.deepin.devicemanager, org.deepin.devicemanager)
DConfig-->>DeviceMonitor: dconfig
DeviceMonitor->>DConfig: isValid()
DConfig-->>DeviceMonitor: bool
alt dconfig_is_valid
DeviceMonitor->>DConfig: keyList()
DConfig-->>DeviceMonitor: keys
alt keys_contains_showScreenSize
DeviceMonitor->>DConfig: value(showScreenSize)
DConfig-->>DeviceMonitor: QVariant
DeviceMonitor->>DeviceMonitor: showScreenSize = value.toBool()
end
end
end
alt showScreenSize_is_true
DeviceMonitor->>DeviceMonitor: addOtherDeviceInfo(Size, m_ScreenSize)
end
DeviceMonitor->>DeviceMonitor: addOtherDeviceInfo(Serial_Number, m_SerialNumber)
Class diagram for DeviceMonitor loadOtherDeviceInfo screen size policyclassDiagram
class DeviceMonitor {
- QString m_MainScreen
- QString m_ScreenSize
- QString m_SerialNumber
+ void loadOtherDeviceInfo()
+ void addOtherDeviceInfo(QString key, QString value)
}
class DConfig {
+ static DConfig* create(QString name, QString path)
+ bool isValid()
+ QStringList keyList()
+ QVariant value(QString key)
}
DeviceMonitor ..> DConfig : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider ensuring the DConfig instance is properly destroyed (e.g., via RAII or an appropriate deleter) to avoid leaking the object created with
DConfig::create. - The config lookup can be simplified and made more robust by using a default value instead of manually checking
keyList().contains(...), e.g.showScreenSize = dconfig->value("showScreenSize", true).toBool();. - Align the new code with existing style conventions (spacing around
ifconditions and braces) to keep the file formatting consistent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider ensuring the DConfig instance is properly destroyed (e.g., via RAII or an appropriate deleter) to avoid leaking the object created with `DConfig::create`.
- The config lookup can be simplified and made more robust by using a default value instead of manually checking `keyList().contains(...)`, e.g. `showScreenSize = dconfig->value("showScreenSize", true).toBool();`.
- Align the new code with existing style conventions (spacing around `if` conditions and braces) to keep the file formatting consistent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
lzwind
approved these changes
Mar 30, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017, 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.
-- Add Group Policy item to control whether to display screen size.
Log: fix issue
Bug: https://pms.uniontech.com/bug-view-354275.html
Summary by Sourcery
Make screen size display in Device Manager conditional on a configurable setting to address incorrect screen size display.
New Features:
Bug Fixes: