Commit 7db1c24
committed
fix: prevent DBus signal infinite loop in QML bindings
Added conditional checks before calling DBus setter methods in all
Switch components to avoid infinite signal loops.
Previously, when a Switch's checked property changed, it would
immediately call the corresponding DBus setter method, which would
emit a signal that updates the model property, causing the Switch's
checked property to update again, creating an infinite loop. Now each
onCheckedChanged handler checks if the new checked value differs from
the current model value before calling the setter, breaking the circular
dependency.
Log: Fixed potential UI freezes caused by infinite signal loops in
update settings
Influence:
1. Test all toggle switches in update settings: function updates,
security updates, third-party updates
2. Verify download speed limit toggle works correctly
3. Test auto-download updates toggle functionality
fix: 修复 QML 绑定中 DBus 信号无限循环问题
在所有 Switch 组件中调用 DBus setter 方法前添加条件检查,避免无限信号
循环。之前,当 Switch 的 checked 属性发生变化时,会立即调
用相应的 DBus setter 方法,这会发出更新模型属性的信号,导致 Switch 的
checked 属性再次更新,形成无限循环。现在每个 onCheckedChanged 处理程序
在调用 setter 之前检查新的 checked 值是否与当前模型值不同,从而打破循环
依赖。
Log: 修复了更新设置中无限信号循环可能导致的界面冻结问题
Influence:
1. 测试更新设置中的所有切换开关:功能更新、安全更新、第三方更新
2. 验证下载速度限制开关正常工作
3. 测试自动下载更新开关功能
PMS: BUG-354897
Change-Id: Id7969f3fdf0dd052494857ef6857f0f75426db561 parent cbdecb2 commit 7db1c24
1 file changed
Lines changed: 27 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
183 | 189 | | |
184 | 190 | | |
185 | 191 | | |
186 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
| |||
256 | 264 | | |
257 | 265 | | |
258 | 266 | | |
259 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
260 | 270 | | |
261 | 271 | | |
262 | 272 | | |
| |||
286 | 296 | | |
287 | 297 | | |
288 | 298 | | |
289 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
290 | 302 | | |
291 | 303 | | |
292 | 304 | | |
| |||
352 | 364 | | |
353 | 365 | | |
354 | 366 | | |
355 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
356 | 370 | | |
357 | 371 | | |
358 | 372 | | |
| |||
366 | 380 | | |
367 | 381 | | |
368 | 382 | | |
369 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
370 | 386 | | |
371 | 387 | | |
372 | 388 | | |
| |||
423 | 439 | | |
424 | 440 | | |
425 | 441 | | |
426 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
427 | 445 | | |
428 | 446 | | |
429 | 447 | | |
| |||
0 commit comments