Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Reviewer's GuideThis refactor makes dde-apps the owner of launcher folder arrangement, pagination, persistence, and mutations, while dde-shell exposes a thin adapter that integrates the shared model with launcher presentation and docking behavior. Sequence diagram for folder arrangement forwardingsequenceDiagram
participant View as Launcher view
participant Adapter as ItemArrangementProxyModel
participant FolderModel as dde-apps shared folder model
participant Apps as AppsModel
View->>Adapter: commitDndOperation(dragId, dropId, op, pageHint)
Adapter->>FolderModel: rearrange(dragId, dropId, op, pageHint)
FolderModel-->>Adapter: arrangementChanged()
Adapter->>Adapter: refreshArrangement()
Adapter-->>View: dataChanged and page-count signals
FolderModel-->>Adapter: folderInfo(id)
Adapter-->>View: folder icons and position roles
Sequence diagram for folder dockingsequenceDiagram
actor User
participant Menu as AppItemMenu
participant Desktop as DesktopIntegration
participant Dock as Dock integration
User->>Menu: Trigger dock menu
Menu->>Desktop: isDockedApp(desktopId)
Desktop->>Dock: isDocked(desktopId)
Dock-->>Desktop: dock state
Desktop-->>Menu: dock state
User->>Menu: Trigger send or remove
Menu->>Desktop: sendToDock(desktopId) or removeFromDock(desktopId)
Desktop->>Dock: sendToDock(desktopId) or removeFromDock(desktopId)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Replace ItemArrangementProxyModel's own folder/pagination/persistence logic with a thin presentation adapter backed by the dde-apps shared folder model through QMetaObject::invokeMethod 2. Remove ItemsPage usage from the item arrangement model and simplify ItemsPageModel to track only page count from the adapter 3. Add folderApplicationBackend property and wire appGroupModel from the dde-apps applet into ItemArrangementProxyModel::setFolderModel in LauncherItem 4. Allow dock/undock operations on internal folder IDs (except internal/ folders/0) in DesktopIntegration and AppItemMenu 5. Bump dde-shell dependency to >> 2.0.60 6. Stop compiling itemspage.cpp in production; keep legacy ItemsPage sources only for the legacy test target 7. Add itemarrangementproxytest covering model identity, forwarding, provider lifetime, and role queries Log: Launcher folders are now managed by the shared dde-apps model, enabling folders to be sent to and removed from the dock Influence: 1. Verify launcher folder display, paging and icon previews still work after the refactor 2. Create, rename and delete folders and confirm changes persist across restarts 3. Drag and drop apps between folders, pages and the top level, including joining/creating folders 4. Send folder entries (internal/folders/N) to the dock and remove them again 5. Confirm that internal/folders/0 cannot be added to the dock and the menu item stays disabled for it 6. Verify app installation/removal updates folder contents and page counts without crashes 7. Run the new itemarrangementproxytest and the existing test suite 8. Check that older saved item-arrangement.ini data migrates or is ignored gracefully refactor: 将文件夹管理委托给 dde-shell 共享模型 1. 移除 ItemArrangementProxyModel 自有的文件夹、分页和持久化逻辑,改为 通过 QMetaObject::invokeMethod 调用 dde-apps 共享文件夹模型的轻量展示适 配层 2. 从排列模型中移除 ItemsPage 依赖,并将 ItemsPageModel 简化为仅跟踪适配 层的页数 3. 在 LauncherItem 中新增 folderApplicationBackend 属性,并将 dde-apps applet 的 appGroupModel 接入 ItemArrangementProxyModel::setFolderModel 4. 在 DesktopIntegration 和 AppItemMenu 中允许对内部文件夹 ID(internal/ folders/0 除外)执行停靠/取消停靠操作 5. 将 dde-shell 依赖版本提升至 >> 2.0.60 6. 生产构建不再编译 itemspage.cpp,仅保留 ItemsPage 源码供旧测试目标使用 7. 新增 itemarrangementproxytest,覆盖模型身份、转发、提供者生命周期和角 色查询 Log: 启动器文件夹改由 dde-apps 共享模型管理,支持将文件夹发送到任务栏或 从任务栏移除 Influence: 1. 验证重构后启动器文件夹的显示、分页和图标预览功能正常 2. 创建、重命名和删除文件夹,确认重启后更改仍然保留 3. 测试应用在文件夹、页面和顶层之间的拖放,包括合并和创建文件夹 4. 将文件夹项(internal/folders/N)发送到任务栏并再次移除 5. 确认 internal/folders/0 无法添加到任务栏且其菜单项保持禁用 6. 验证应用安装/卸载后文件夹内容和页数更新且不崩溃 7. 运行新增的 itemarrangementproxytest 及现有测试套件 8. 检查旧的 item-arrangement.ini 数据能否正常迁移或被安全忽略 PMS: TASK-397247 TASK-396759
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['建议在 dataChanged 信号连接中增加 role 过滤,仅在相关 role(如 DesktopIdRole、IconNameRole)变化时触发 refreshArrangement()', '建议对 match() 返回空列表的情况增加 qCWarning 日志,便于调试'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['建议为 rebuildFolders()、data() 等关键方法增加注释,说明委托模式和行偏移计算逻辑', '建议将 internal/folders/ 前缀检查提取为辅助函数,减少 desktopintegration.cpp 中的重复', '建议在后续提交中修正 creatEmptyPage 拼写错误'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['可考虑在 setFolderModel 时缓存 folder id 到 name 的映射,避免 data() 中每次 match() 查找', '建议 dataChanged 连接增加 role 过滤参数,减少不必要的 refreshArrangement() 调用'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 建议优化:在构造函数中为 dataChanged 连接增加 role 过滤
// 修改前:
connect(&apps, &QAbstractItemModel::dataChanged, this, [this] { refreshArrangement(); });
// 修改后:仅在相关 role 变化时刷新
connect(&apps, &QAbstractItemModel::dataChanged, this, [this](const QModelIndex &, const QModelIndex &, const QList<int> &roles) {
if (roles.isEmpty() ||
roles.contains(AppsModel::DesktopIdRole) ||
roles.contains(AppsModel::IconNameRole) ||
roles.contains(AppsModel::NameRole)) {
refreshArrangement();
}
});本报告由 AI 代码审查工具自动生成 |
Log: Launcher folders are now managed by the shared dde-apps model, enabling folders to be sent to and removed from the dock
Influence:
refactor: 将文件夹管理委托给 dde-shell 共享模型
Log: 启动器文件夹改由 dde-apps 共享模型管理,支持将文件夹发送到任务栏或
从任务栏移除
Influence:
PMS: TASK-397247 TASK-396759
Summary by Sourcery
Delegate launcher folder management to the shared dde-apps model while retaining the launcher’s presentation and integration interfaces.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests: