Commit 903d956
committed
fix: fix network details management with pointer-based tracking
Changed the network details management from using name strings to using
object pointers as unique identifiers. Previously, using names could
cause issues when multiple network details had the same name. Now we use
NetworkDetails object pointers to uniquely identify each details item,
ensuring proper tracking and cleanup.
The updateDetails() function now:
1. Uses NetworkDetails* pointers as keys in m_detailsItemsMap instead of
name strings
2. Generates unique IDs using the object pointer address
(detail_<pointer_address>)
3. Properly identifies items to remove by comparing current
NetworkDetails objects with stored ones
4. Removes items when their NetworkDetails objects are no longer in the
controller's list
5. Adds new items when NetworkDetails objects appear in the controller's
list
6. Updates data for all existing items using their unique IDs
This prevents issues where network details with duplicate names could
cause incorrect item removal or data updates.
Log: Fixed network details display issues when multiple networks have
the same name
Influence:
1. Test network details display with multiple networks
2. Verify details are correctly added and removed when networks appear/
disappear
3. Test scenarios where networks might have identical names
4. Verify data updates correctly when network information changes
5. Test network switching and ensure details update properly
6. Check memory management to ensure no leaks from pointer-based
tracking
fix: 修复网络详情管理,使用基于指针的跟踪机制
将网络详情管理从使用名称字符串改为使用对象指针作为唯一标识符。之前使用名
称可能导致多个网络详情具有相同名称时出现问题。现在使用 NetworkDetails 对
象指针来唯一标识每个详情项,确保正确的跟踪和清理。
updateDetails() 函数现在:
1. 使用 NetworkDetails* 指针作为 m_detailsItemsMap 的键,而不是名称字
符串
2. 使用对象指针地址生成唯一ID(detail_<指针地址>)
3. 通过比较当前 NetworkDetails 对象与存储的对象来正确识别需要删除的项
4. 当 NetworkDetails 对象不再存在于控制器列表中时删除相应项
5. 当 NetworkDetails 对象出现在控制器列表中时添加新项
6. 使用唯一ID为所有现有项更新数据
这防止了当网络详情具有重复名称时可能导致错误项删除或数据更新的问题。
Log: 修复了当多个网络具有相同名称时的网络详情显示问题
Influence:
1. 测试多个网络时的网络详情显示
2. 验证网络出现/消失时详情是否正确添加和删除
3. 测试网络可能具有相同名称的场景
4. 验证网络信息变化时数据是否正确更新
5. 测试网络切换并确保详情正确更新
6. 检查内存管理,确保基于指针的跟踪不会导致内存泄漏
PMS: BUG-3424571 parent 8e33b75 commit 903d956
2 files changed
Lines changed: 45 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2401 | 2401 | | |
2402 | 2402 | | |
2403 | 2403 | | |
2404 | | - | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2405 | 2430 | | |
2406 | 2431 | | |
2407 | | - | |
2408 | | - | |
2409 | | - | |
2410 | | - | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
2411 | 2441 | | |
2412 | | - | |
| 2442 | + | |
| 2443 | + | |
2413 | 2444 | | |
2414 | 2445 | | |
2415 | 2446 | | |
| 2447 | + | |
2416 | 2448 | | |
2417 | 2449 | | |
| 2450 | + | |
| 2451 | + | |
2418 | 2452 | | |
2419 | 2453 | | |
2420 | 2454 | | |
2421 | 2455 | | |
2422 | | - | |
2423 | | - | |
| 2456 | + | |
| 2457 | + | |
2424 | 2458 | | |
2425 | 2459 | | |
2426 | | - | |
2427 | | - | |
2428 | | - | |
2429 | | - | |
2430 | 2460 | | |
2431 | 2461 | | |
2432 | 2462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
287 | | - | |
| 289 | + | |
288 | 290 | | |
289 | 291 | | |
290 | 292 | | |
| |||
0 commit comments