Repository navigation
fix: add kApp to desktop organizer categories - #4673
GongHeng2017 wants to merge 1 commit into
Conversation
1. Root cause: the organizeCategories DConfig default value lists kDocument/kPicture/kVideo/kMusic/kFolder but omits kApp, so the Application category collection is never created during desktop organization 2. Fix: prepend "kApp" to organizeCategories.value so the Application collection is created by default and .desktop shortcuts are filed into it instead of being dropped or misfiled under Other 3. Impact: only the config default changes, no code logic change; existing users with a persisted DConfig value are unaffected, new or reset users get the Application category enabled Log: Desktop organizer now groups applications into the Application category by default Influence: 1. Verify newly installed apps (generating .desktop) appear under the Application category after desktop organization 2. Verify the existing Document/Picture/Video/Music/Folder categories still organize correctly 3. Verify users with a previously persisted organizeCategories value are not affected fix: 桌面整理默认分类补充应用程序类别 1. 根因:organizeCategories 配置默认值包含 kDocument/kPicture/kVideo/kMusic/kFolder 但缺少 kApp,导致桌面整理 时不创建"应用程序"集合,.desktop 快捷方式被丢弃或误归"其他" 2. 方案:在 organizeCategories.value 首部新增 "kApp",使桌面整理默认 创建"应用程序"集合,.desktop 文件正确归入该集合 3. 影响:仅变更配置默认值,无代码逻辑改动;已持久化配置的用户不受 影响,新用户或重置配置的用户默认启用"应用程序"分类 Log: 桌面整理默认将应用程序归入"应用程序"分类 Influence: 1. 验证新安装应用(生成 .desktop)在桌面整理后归入"应用程序"分类 2. 验证原有 文档/图片/视频/音乐/文件夹 五类归档行为正常 3. 验证已持久化 organizeCategories 配置的用户不受默认值变更影响 PMS: BUG-255421
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis low-risk configuration-only fix adds File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017 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 |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: JSON 语法正确,新增 "kApp" 字符串元素到数组中符合 JSON 规范。配置项 description 字段明确列出 kApp(应用)为合法选项,逻辑上补充了缺失的默认分类,与文档描述一致。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 变更范围极小(仅新增一个数组元素),commit message 详尽包含根因分析、修复方案、影响评估及验证步骤(中英双语)。配置文件本身包含完整的 name/description 中英文字段,结构清晰。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 在配置数组中新增一个元素对性能无影响,无需关注算法复杂度或资源使用。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 本次变更为纯配置默认值修改,不涉及用户输入处理、命令执行、文件路径操作或敏感信息,不存在安全风险。 💡 改进建议代码示例// 本次变更为 DConfig 配置默认值修改,无需代码修复示例
// 变更内容:organizeCategories.value 数组新增 "kApp" 元素
// 文件:assets/configs/org.deepin.dde.file-manager.desktop.organizer.json本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 6.6.7 |
Root Cause Analysis
Desktop organizer's DConfig default value
organizeCategorieslistskDocument/kPicture/kVideo/kMusic/kFolderbut omitskApp.TypeClassifier::classify()correctly identifies.desktopfiles askTypeKeyApp, but since no"kApp"collection is configured,classes()never creates an Application collection. The classification result"Type_Apps"finds no matching collection, so.desktopshortcuts are dropped or (in some versions) misfiled under "Other". Key evidence:assets/configs/org.deepin.dde.file-manager.desktop.organizer.json:61(missingkApp);configpresenter.cpp:281(enabledTypeCategoriesiterates the config array);typeclassifier.cpp:112(classesbuilds collections from config).Fix
Prepend
"kApp"toorganizeCategories.valueso the Application collection is created by default and.desktopshortcuts are filed into it. No code logic change — only the config default value changes.Change Safety Assessment
Code Safety
organizeCategoriesconsumerConfigPresenter::enabledTypeCategories()iterates the config array and matches strings toItemCategoriesflags —"kApp"maps tokCatApplication, behaving identically to the existing 5 entries.organizeCategoriesline was last touched by commit86a3f699(custom action argument replacement, unrelated to category semantics); this change does not revert any historical fix.Business Impact Scope
.desktop) will be grouped into the "Application" category instead of being dropped or misfiled under "Other". The existing Document/Picture/Video/Music/Folder categories are unchanged.organizeCategoriesDConfig value are unaffected — the default only applies to new or reset configurations.Verification Suggestion
.desktopappears under the "Application" category.根因分析
桌面整理的 DConfig 默认值
organizeCategories包含kDocument/kPicture/kVideo/kMusic/kFolder但缺少kApp。TypeClassifier::classify()能正确识别.desktop文件为kTypeKeyApp,但由于配置中无"kApp",classes()不会创建"应用程序"集合,分类结果"Type_Apps"找不到对应集合,.desktop快捷方式被丢弃或误归"其他"。关键证据:assets/configs/org.deepin.dde.file-manager.desktop.organizer.json:61(缺少kApp);configpresenter.cpp:281(enabledTypeCategories遍历配置数组);typeclassifier.cpp:112(classes根据配置构建集合)。修复方案
在
organizeCategories.value首部新增"kApp",使桌面整理默认创建"应用程序"集合,.desktop文件正确归入该集合。无代码逻辑改动,仅变更配置默认值。改动安全评估
代码安全评估
organizeCategories的消费方ConfigPresenter::enabledTypeCategories()遍历配置数组并按字符串匹配置位ItemCategories标志——"kApp"映射到kCatApplication,行为与已有 5 项完全一致。organizeCategories行最近由提交86a3f699(自定义动作参数替换,与分类语义无关)触碰,本次变更不会撤销任何历史修复。业务影响范围
.desktop)将归入"应用程序"分类,而非被丢弃或误归"其他"。原有 文档/图片/视频/音乐/文件夹 五类归档行为不变。organizeCategories配置的用户不受影响——默认值仅对新用户或重置配置的用户生效。验证建议
.desktop出现在"应用程序"分类。Summary by Sourcery
Bug Fixes: