feat: add package name search configuration#594
Conversation
Reviewer's GuideThis PR integrates a new DConfig-based toggle to enable or disable package name searching globally and extends the existing SearchFilterProxyModel to dynamically react to configuration changes and weight matches against the app’s desktopId when enabled. Sequence diagram for dynamic update of search behavior via DConfigsequenceDiagram
participant User
participant DConfig
participant SearchFilterProxyModel
User->>DConfig: Change "searchPackage" setting
DConfig-->>SearchFilterProxyModel: valueChanged("searchPackage")
SearchFilterProxyModel->>DConfig: value("searchPackage", false)
SearchFilterProxyModel->>SearchFilterProxyModel: Update m_searchPackageEnabled
SearchFilterProxyModel->>SearchFilterProxyModel: invalidateFilter()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @wjyrich - I've reviewed your changes - here's some feedback:
- Pass
thisas the parent in DConfig::create to ensure the DConfig instance is properly cleaned up instead of leaking. - Move m_dconfig and m_searchPackageEnabled into a private section in the header to avoid exposing internal state.
- Extract the desktopId search clauses out of calculateWeight into a helper method to keep the weight logic more focused.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Pass `this` as the parent in DConfig::create to ensure the DConfig instance is properly cleaned up instead of leaking.
- Move m_dconfig and m_searchPackageEnabled into a private section in the header to avoid exposing internal state.
- Extract the desktopId search clauses out of calculateWeight into a helper method to keep the weight logic more focused.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
d4586aa to
80cabf6
Compare
deepin pr auto review关键摘要:
是否建议立即修改: |
1. Added new DConfig setting "searchPackage" to control package name search functionality 2. Implemented package name search in SearchFilterProxyModel when enabled 3. Added DConfig monitoring to dynamically update search behavior when setting changes 4. Package name search includes exact match, starts with, and contains matching 5. Added desktopId comparison in calculateWeight method for package name matching The changes allow users to enable/disable package name searching through DConfig, providing more flexible search options. This is particularly useful for technical users who may want to search applications by their package names. feat: 添加包名搜索配置功能 1. 新增 DConfig 设置项 "searchPackage" 用于控制包名搜索功能 2. 在 SearchFilterProxyModel 中实现包名搜索功能(当启用时) 3. 添加 DConfig 监听以动态更新搜索行为 4. 包名搜索支持精确匹配、开头匹配和包含匹配 5. 在 calculateWeight 方法中添加 desktopId 比较用于包名匹配 这些改动允许用户通过 DConfig 启用/禁用包名搜索功能,提供更灵活的搜索选 项。对于技术用户来说特别有用,他们可能希望通过包名来搜索应用程序。
80cabf6 to
8a58428
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, wjyrich 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 |
|
/forcemerge |
|
This pr force merged! (status: behind) |
| "description": "Whether to allow the search for Desktop ID during the search.", | ||
| "description[zh_CN]": "在搜索时候是否允许搜索Desktop ID。", | ||
| "permissions": "readwrite", | ||
| "visibility": "private" |
There was a problem hiding this comment.
visibility为private,表明它是私有的配置,仅当前应用设置,你这个之后可能由dde-control-center改写吧,是不是应该是public的,
The changes allow users to enable/disable package name searching through DConfig, providing more flexible search options. This is particularly useful for technical users who may want to search applications by their package names.
feat: 添加包名搜索配置功能
这些改动允许用户通过 DConfig 启用/禁用包名搜索功能,提供更灵活的搜索选
项。对于技术用户来说特别有用,他们可能希望通过包名来搜索应用程序。
Summary by Sourcery
Enable users to search applications by package name by adding a DConfig-controlled switch and matching logic in SearchFilterProxyModel
New Features:
searchPackageto toggle package name search