fix: Gray out update transfer interface when updates are disabled#294
Conversation
[V25 2500U1][Update Management System][Control Center Update Client][Tenth Round Testing][System Update][Public Network][Control Center][System Update] When checking for updates is turned off, the transfer optimization related configuration items should be grayed out and non-operable Log: As above Bug: https://pms.uniontech.com/bug-view-360209.html Influence: Affects the update transfer interface when updates are disabled fix: 更新被禁用时更新传递界面置灰 【V25 2500U1】【更新管理系统】【控制中心更新客户端】【第十轮测试】【系统更新】【公网】【控制中心】【系统更新】关闭检查更新,传递优化相关配置项需要置灰不可操作 Log:如上所述 Bug:https://pms.uniontech.com/bug-view-360209.html Influence:影响更新被禁用时更新传递界面
deepin pr auto review这份代码变更主要涉及更新设置界面的UI逻辑控制、以及插件显示名称和提示文本的国际化修改。我将从语法逻辑、代码质量、代码性能和代码安全四个方面进行审查。 1. 语法逻辑UpdateSetting.qml
privatelastoreplugin.cpp & tipswidget.cpp
翻译文件 (.ts)
2. 代码质量UpdateSetting.qml
tipswidget.cpp
3. 代码性能
4. 代码安全
总结与具体改进建议这份代码变更整体质量良好,逻辑清晰,修复了更新被禁止时 UI 状态不一致的问题,并优化了用户提示文案。 建议的改进代码(针对 UpdateSetting.qml 的重复逻辑问题): 虽然不能直接在 QML 中定义函数,但可以通过绑定表达式的优化来减少视觉上的重复(如果逻辑允许)。不过在此处,最根本的优化在于后端模型。 C++ 模型侧优化建议(伪代码): 假设 // updateModel.h
class UpdateModel : public QObject {
Q_OBJECT
Q_PROPERTY(bool updateProhibited READ updateProhibited NOTIFY updateProhibitedChanged)
// 新增一个聚合属性,用于判断是否允许修改更新设置
Q_PROPERTY(bool canModifyUpdateSettings READ canModifyUpdateSettings NOTIFY updateProhibitedChanged)
public:
bool updateProhibited() const;
bool canModifyUpdateSettings() const {
// 如果有其他条件,也可以在这里聚合,例如 !isPrivateUpdate && !updateProhibited
return !m_updateProhibited;
}
// ...
};QML 侧优化后的代码: // 修改前
enabled: !dccData.model().isPrivateUpdate && !dccData.model().updateProhibited
// 修改后 (如果后端添加了 canModifyUpdateSettings)
enabled: !dccData.model().isPrivateUpdate && dccData.model().canModifyUpdateSettings或者更进一步,如果 bool canModifyDeliverySettings() const {
return !m_isPrivateUpdate && !m_updateProhibited;
}这样 QML 侧只需写: enabled: dccData.model().canModifyDeliverySettings关于文案修改的补充: |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ut005973, xionglinlin 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 |
[V25 2500U1][Update Management System][Control Center Update Client][Tenth Round Testing][System Update][Public Network][Control Center][System Update] When checking for updates is turned off, the transfer optimization related configuration items should be grayed out and non-operable
Log: As above
Bug: https://pms.uniontech.com/bug-view-360209.html
Influence: Affects the update transfer interface when updates are disabled
fix: 更新被禁用时更新传递界面置灰
【V25 2500U1】【更新管理系统】【控制中心更新客户端】【第十轮测试】【系统更新】【公网】【控制中心】【系统更新】关闭检查更新,传递优化相关配置项需要置灰不可操作
Log:如上所述
Bug:https://pms.uniontech.com/bug-view-360209.html Influence:影响更新被禁用时更新传递界面