Repository navigation
feat: expose localized Keywords in the app model (linuxdeepin/developer-center#3375) - #1776
Conversation
1. Add the Keywords role and consume the application manager's per-locale
keyword lists during initialization and property updates.
2. Generalize the existing locale fallback helper for QString and
QStringList values, preserving its empty-value behavior.
3. Store the selected locale in the existing scalar GenericName role and
add tests for exact, language and default fallback at both entry points.
Log: Provide locale-selected generic names and keywords to model consumers
Influence: GenericName now uses the selected locale instead of always
using the default value. Keywords retains all words from that
locale; default values are only used as fallbacks.
feat: 在共享应用模型中暴露本地化的应用关键词
1. 新增 Keywords 角色,在初始化和属性更新时读取应用管理器提供的
按 locale 划分的关键词列表。
2. 将既有 locale 回退函数泛化为同时支持 QString 和 QStringList,
保留遇到已存在的空值键时停止回退的行为。
3. 通过既有单数 GenericName 角色保存选中 locale 的值,并为两个入口
补充精确 locale、语言及默认值回退测试。
Log: 为模型消费者提供按 locale 选择的通用名称和关键词
Influence: GenericName 改为使用选中 locale 的值,不再固定读取默认值;
Keywords 保留该 locale 内的所有词,默认值仅用于回退。
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Hi @foresee-io. Thanks for your PR. 😃 |
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
Hi @foresee-io. 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 GuideThe PR propagates dde-application-manager Keywords metadata into the shared application model by registering its localized string-list type, applying the existing locale fallback policy, synchronizing changes from D-Bus properties, and exposing the result through a new keywords role. Sequence diagram for localized Keywords propagationsequenceDiagram
participant AM as dde-application-manager
participant Item as AMAppItem
participant Model as AppItemModel
participant Consumer as SearchConsumer
AM->>Item: appInfo Keywords
Item->>Item: getLocaleOrDefaultValue
Item->>Model: setKeywords
Model-->>Consumer: keywords via KeywordsRole
AM->>Item: onPropertyChanged Keywords
Item->>Item: qdbus_cast<QStringListMap>
Item->>Item: getLocaleOrDefaultValue
Item->>Model: setKeywords
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
I have read the CLA Document and I hereby sign the CLA. |
BLumia
left a comment
There was a problem hiding this comment.
此 PR 没引入实际的功能需求,只是暴露数据给其他组件使用,是没问题的。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, foresee-io 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 |
Related to linuxdeepin/developer-center#3375.
Application search consumers need access to the
Keywordsmetadata exposed bydde-application-manager.This PR adds a
Keywordsrole to the shared application model, selecting the applicable locale with fallback and updating the role when application properties change. It reuses the existing locale fallback helper for string and string-list values.Depends on the corresponding
dde-application-managerchange.应用搜索组件需要通过共享应用模型获取
dde-application-manager提供的Keywords元数据。本 PR 为共享应用模型新增
Keywords角色,按照当前 locale 及回退规则选择关键词,并在应用属性变化时同步更新。同时复用既有的 locale 回退函数,支持字符串和字符串列表。依赖对应的
dde-application-manager修改。Summary by Sourcery
Expose localized application keywords through the shared app model for search consumers.
New Features:
Enhancements:
Chores: