-
Notifications
You must be signed in to change notification settings - Fork 48
WIP: refactor: migrate taskmanager model to the new DockItemModel #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
切换 taskmanager 区域的 model 为新的 DockItemModel,以解决一系列问题: 1. 部分场景下企业微信和微信图标合并/钉钉和微信合并等问题 2. 终端执行 gitk/dde-dconfig-editor 时不会单独显示任务栏图标 3. 没有 desktop-id 的带界面的可执行程序不会单独显示任务栏图标 Log:
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Reviewer's GuideThis PR migrates the TaskManager area to the new DockItemModel, refactoring window previews, monitors, TaskManager APIs, and QML delegates to operate on QModelIndexList and the AbstractTaskManagerInterface, while removing legacy AppItem/ItemModel code and updating tests. Sequence diagram for window preview request using new modelsequenceDiagram
participant User as actor User
participant AppItem as AppItem (QML)
participant TaskManagerQML as TaskManagerQML
participant TaskManager as TaskManager
participant AbstractWindowMonitor as AbstractWindowMonitor
participant X11WindowPreviewContainer as X11WindowPreviewContainer
User->>AppItem: Hover or click triggers preview
AppItem->>TaskManagerQML: requestPreview([modelIndex], Panel.rootObject, xOffset, yOffset, position)
TaskManagerQML->>TaskManager: requestPreview(...)
TaskManager->>AbstractWindowMonitor: requestPreview(QModelIndexList, ...)
AbstractWindowMonitor->>X11WindowPreviewContainer: showPreview(QModelIndexList, ...)
X11WindowPreviewContainer->>DockItemWindowModel: setData(QModelIndexList)
X11WindowPreviewContainer->>X11WindowPreviewContainer: updatePreviewIconFromBase64(...)
X11WindowPreviewContainer->>X11WindowPreviewContainer: updatePreviewTitle(...)
X11WindowPreviewContainer->>X11WindowPreviewContainer: updateSize(...)
Class diagram for TaskManager model migration to DockItemModelclassDiagram
class TaskManager {
+DockItemModel* dataModel() const
+void dropFilesOnItem(QString, QStringList)
+void hideItemPreview()
...
}
class DockItemModel {
+void setSourceModel(QAbstractItemModel*)
+void dumpItemInfo(QModelIndex)
...
}
class AbstractWindowMonitor {
+QPointer<AbstractWindow> getWindowByWindowId(ulong)
+void requestActivate(QModelIndex) const
+void requestPreview(QModelIndexList, QObject*, int32_t, int32_t, uint32_t) const
+void requestClose(QModelIndex, bool) const
...
}
class X11WindowMonitor {
+void requestPreview(QModelIndexList, QObject*, int32_t, int32_t, uint32_t) const
+void hideItemPreview()
...
}
class TreeLandWindowMonitor {
+void requestPreview(QModelIndexList, QObject*, int32_t, int32_t, uint32_t) const
+void hideItemPreview()
...
}
class DockItemWindowModel {
+int rowCount(QModelIndex) const
+QVariant data(QModelIndex, int) const
+void setData(QModelIndexList)
+void resetPreviewPixmap()
...
}
TaskManager --> DockItemModel : uses
TaskManager --> AbstractWindowMonitor : owns
AbstractWindowMonitor <|-- X11WindowMonitor
AbstractWindowMonitor <|-- TreeLandWindowMonitor
X11WindowMonitor --> DockItemWindowModel : uses
TreeLandWindowMonitor --> DockItemWindowModel : uses
Class diagram for QML delegate and AppItem changesclassDiagram
class AppItem {
+string itemId
+string name
+string iconName
+string icon
+list<string> windows
+int visualIndex
+var modelIndex
+signal dropFilesOnItem(itemId, files)
+signal dragFinished()
...
}
class TaskManagerQML {
+void requestActivate(var modelIndex)
+void requestNewInstance(var modelIndex, string action)
+void requestPreview(var indexes, QObject, int32_t, int32_t, uint32_t)
...
}
AppItem --> TaskManagerQML : calls methods
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR 当前状态说明:
切换 taskmanager 区域的 model 为新的 DockItemModel,以解决一系列问题:
Summary by Sourcery
Migrate the TaskManager from the old AppItem/ItemModel architecture to the new DockItemModel, refactor preview and activation APIs, and update QML bindings and tests accordingly.
New Features:
Bug Fixes:
Enhancements:
Tests: