Commit 6ccfadf
committed
fix: improve update module state management
1. Replaced hasHandledChildrenChange with more descriptive hasView
property
2. Added Component.onDestruction handler to track view lifecycle
3. Consolidated update check logic in updateMain.qml with hasCheckUpdate
flag
4. Improved comments explaining the purpose of each signal and property
5. Combined multiple Connections blocks into a single one for better
organization
The changes improve the reliability of update checks by:
- Better tracking when the update view is active/inactive
- Preventing duplicate update checks
- Making the code more maintainable with clearer state management
- Handling edge cases when the module is accessed via DBus
fix: 改进更新模块状态管理
1. 用更具描述性的 hasView 属性替换了 hasHandledChildrenChange
2. 添加 Component.onDestruction 处理程序来跟踪视图生命周期
3. 在 updateMain.qml 中使用 hasCheckUpdate 标志统一更新检查逻辑
4. 改进了注释,更清楚地解释每个信号和属性的用途
5. 将多个 Connections 块合并为一个以提高组织性
这些改进通过以下方式提高了更新检查的可靠性:
- 更好地跟踪更新视图的激活/非激活状态
- 防止重复的更新检查
- 通过更清晰的状态管理使代码更易于维护
- 处理通过 DBus 访问模块时的边缘情况
pms: Bug-3165891 parent 420929d commit 6ccfadf
2 files changed
Lines changed: 24 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
| 21 | + | |
17 | 22 | | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
20 | 33 | | |
21 | 34 | | |
| 35 | + | |
22 | 36 | | |
23 | 37 | | |
| 38 | + | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
27 | 42 | | |
28 | 43 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 44 | + | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
| |||
0 commit comments