Skip to content

fix: improve update checking mechanism and activation state#73

Merged
xionglinlin merged 1 commit into
linuxdeepin:masterfrom
xionglinlin:master
May 20, 2025
Merged

fix: improve update checking mechanism and activation state#73
xionglinlin merged 1 commit into
linuxdeepin:masterfrom
xionglinlin:master

Conversation

@xionglinlin

Copy link
Copy Markdown
Contributor
  1. Changed default systemActivation state to true in UpdateModel for proper initialization
  2. Added m_doCheckUpdates flag to prevent duplicate update checks
  3. Modified update checking logic to use new activeUpdateModel signal instead of ActiveObjectChanged
  4. Added count property and childrenChanged handler in update.qml to ensure proper timing for update checks
  5. Simplified updateMain.qml to use direct signal connection for update checks

The changes address several issues:

  • Prevents duplicate update checks when switching modules
  • Ensures update checks happen at the right time when entering the module
  • Improves initialization state management
  • Makes the update checking process more reliable and predictable

fix: 改进更新检查机制和激活状态

  1. 在UpdateModel中将默认systemActivation状态改为true以正确初始化
  2. 添加m_doCheckUpdates标志防止重复检查更新
  3. 修改更新检查逻辑,使用新的activeUpdateModel信号替代 ActiveObjectChanged
  4. 在update.qml中添加count属性和childrenChanged处理程序以确保更新检查的 正确时机
  5. 简化updateMain.qml,使用直接信号连接进行更新检查

这些更改解决了以下问题:

  • 防止切换模块时重复检查更新
  • 确保进入模块时在正确时间检查更新
  • 改进初始化状态管理
  • 使更新检查过程更可靠和可预测

pms: Bug-316589

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. UpdateModel 构造函数中的默认值更改

    • UpdateModel 构造函数中,m_systemActivation 的默认值从 false 改为 true。需要确认这一更改是否符合业务逻辑需求,并确保相关的逻辑处理已经更新以适应这一变化。
  2. UpdateWorker 类中的 m_doCheckUpdates 成员变量

    • 新增的 m_doCheckUpdates 成员变量用于防止重复检查更新。这是一个好的做法,可以避免在更新过程中重复发起更新检查请求。但是,需要确保在所有可能触发更新检查的地方都正确地设置了 m_doCheckUpdates 的值。
  3. UpdateWorker 类中的 checkNeedDoUpdates 方法

    • checkNeedDoUpdates 方法中,添加了对 m_doCheckUpdates 的检查,以避免重复检查更新。这是一个合理的改动,可以防止不必要的重复操作。
  4. UpdateWorker 类中的 doCheckUpdates 方法

    • doCheckUpdates 方法中,设置 m_doCheckUpdates = true,并在检查更新完成后将其重置为 false。这是一个好的做法,可以确保更新检查的原子性。
  5. UpdateWorker 类中的 onCheckUpdateStatusChanged 方法

    • onCheckUpdateStatusChanged 方法中,设置 m_doCheckUpdates = false,以确保在更新检查失败或成功后,可以再次进行更新检查。这是一个合理的改动。
  6. UpdateWorker 类中的 UpdateWorker 构造函数

    • UpdateWorker 构造函数中新增了 m_doCheckUpdates 的初始化。这是一个好的做法,可以确保 m_doCheckUpdates 在对象创建时有一个明确的初始值。
  7. qml 文件中的 update.qml

    • update.qml 文件中,通过 Component.onCompletedonChildrenChanged 信号触发 activeUpdateModel 信号。这种方式可以确保在模块激活时进行更新检查。但是,count 计数器用于避免多次执行,这可能不是最优的解决方案。可以考虑使用其他方式来确保 activeUpdateModel 信号只被触发一次。
  8. qml 文件中的 updateMain.qml

    • updateMain.qml 文件中,将 DccApp 替换为 dccModule 作为信号的目标。这是一个好的改动,可以确保信号的正确传递。

总体来说,代码的改动是合理的,但需要注意确保所有相关的逻辑都得到了更新,并且测试这些改动以确保它们不会引入新的问题。

1. Changed default systemActivation state to true in UpdateModel for
proper initialization
2. Added m_doCheckUpdates flag to prevent duplicate update checks
3. Modified update checking logic to use new activeUpdateModel signal
instead of ActiveObjectChanged
4. Added count property and childrenChanged handler in update.qml to
ensure proper timing for update checks
5. Simplified updateMain.qml to use direct signal connection for update
checks

The changes address several issues:
- Prevents duplicate update checks when switching modules
- Ensures update checks happen at the right time when entering the
module
- Improves initialization state management
- Makes the update checking process more reliable and predictable

fix: 改进更新检查机制和激活状态

1. 在UpdateModel中将默认systemActivation状态改为true以正确初始化
2. 添加m_doCheckUpdates标志防止重复检查更新
3. 修改更新检查逻辑,使用新的activeUpdateModel信号替代
ActiveObjectChanged
4. 在update.qml中添加count属性和childrenChanged处理程序以确保更新检查的
正确时机
5. 简化updateMain.qml,使用直接信号连接进行更新检查

这些更改解决了以下问题:
- 防止切换模块时重复检查更新
- 确保进入模块时在正确时间检查更新
- 改进初始化状态管理
- 使更新检查过程更可靠和可预测

pms: Bug-316589
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy, xionglinlin

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@xionglinlin xionglinlin merged commit d0e3c46 into linuxdeepin:master May 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants