fix(appmgr): defer apps until theme icon resolves - #794
Conversation
There was a problem hiding this comment.
Sorry @MyLeeJiEun, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun 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 |
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's GuideAdds a theme-icon resolution helper and defers new app items whose icons are not yet resolvable, periodically rechecking and promoting them when icons become available while extending the pending timeout window. Sequence diagram for deferred app item icon resolutionsequenceDiagram
actor AppSource
participant AppMgr
participant QIconTheme as QIcon
AppSource->>AppMgr: watchingAppItemAdded(key, appItem)
AppMgr->>AppMgr: resolvedIconPath(appItem)
AppMgr->>QIconTheme: QIcon::fromTheme(appItem->iconName)
alt icon resolvable
QIconTheme-->>AppMgr: non-null QIcon
AppMgr->>AppMgr: appItem->iconName = resolved
AppMgr-->>AppSource: app item added with icon
else icon not resolvable
QIconTheme-->>AppMgr: null QIcon
AppMgr->>AppMgr: m_pendingAppItems[key] = appItem
AppMgr->>AppMgr: m_checkTimer->start()
end
loop periodic icon checks
AppMgr->>AppMgr: checkPendingAppItems()
AppMgr->>QIconTheme: QIcon::setThemeSearchPaths(QIcon::themeSearchPaths())
AppMgr->>AppMgr: resolvedIconPath(appItem)
AppMgr->>QIconTheme: QIcon::fromTheme(appItem->iconName)
alt icon now resolvable
QIconTheme-->>AppMgr: non-null QIcon
AppMgr->>AppMgr: appItem->iconName = resolved
AppMgr->>AppMgr: itemsToProcess.append(key, appItem)
AppMgr->>AppSource: promote app item
else still unresolved and timeout not reached
AppMgr->>AppMgr: keep in m_pendingAppItems
else timeout reached (m_checkCount >= 40)
AppMgr->>AppMgr: force process remaining pending items
AppMgr->>AppSource: add app items even without icons
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Add resolvedIconPath() to check if a theme icon name resolves to a real icon via QIcon::fromTheme 2. Defer newly added app items with unresolved theme icons to the pending queue and start the check timer 3. Reload theme search paths on each pending check so icons appearing after startup become visible 4. Promote pending items once their icon resolves; force-process leftovers after the 120s timeout 5. Extend the pending-item timeout from 60s to 120s to cover slow theme initialization Log: Defer app items with unresolvable theme icons until the icon becomes available, then promote them. Influence: Apps with null icons now show once the icon is available. fix(appmgr): 主题图标未解析的应用延迟到图标可用后再添加 1. 新增 resolvedIconPath(),通过 QIcon::fromTheme 判断主题图标名是否可解析为真实图标 2. 图标未解析的新增应用项先放入待处理队列并启动检查定时器 3. 每次待处理检查时刷新主题搜索路径,使启动后新出现的图标可见 4. 图标可解析后立即提升待处理项,超过 120 秒超时则强制处理剩余项 5. 待处理项超时从 60 秒延长至 120 秒,以覆盖主题初始化较慢的场景 Log: 将主题图标无法解析的应用延迟处理,待图标可用后再提升。 PMS: BUG-371833 Influence: 图标为 null 的应用在图标可用后正常显示。
887d2cf to
571dce2
Compare
| // initialized at startup). For: bug-347859, bug-371833. | ||
| const bool resolvable = QFileInfo(iconName).isAbsolute() | ||
| ? QFileInfo::exists(iconName) | ||
| : iconName.isEmpty() || !QIcon::fromTheme(iconName).isNull(); |
There was a problem hiding this comment.
QIcon::fromTheme不能判断路径么?
| ++m_checkCount; | ||
|
|
||
| // Reload theme search paths so icons appearing after startup become visible. | ||
| QIcon::setThemeSearchPaths(QIcon::themeSearchPaths()); |
There was a problem hiding this comment.
这个会清除所有已经加载了的图标的,真的要每次都执行一次么?
Log: Defer app items with unresolvable theme icons until the icon becomes available, then promote them.
Influence: Apps with null icons now show once the icon is available.
fix(appmgr): 主题图标未解析的应用延迟到图标可用后再添加
Log: 将主题图标无法解析的应用延迟处理,待图标可用后再提升。
PMS: BUG-371833
Influence: 图标为 null 的应用在图标可用后正常显示。
Summary by Sourcery
Defer adding app items whose theme-based icons are not yet resolvable, and promote them once their icons become available.
Bug Fixes:
Enhancements: