chore: use roles defined in TaskManager class#1198
Merged
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThis PR consolidates role definitions by replacing the AbstractWindow enum with TaskManager role constants, updating roleNames mappings, data switch statements, dataChanged signals, and adjusting includes and forward declarations to prepare for combined-model integration. Class diagram for role constant refactoring in AbstractWindow and TaskManagerclassDiagram
class AbstractWindow {
<<QObject>>
+~AbstractWindow()
+uint32_t id() = 0
+uint32_t pid() = 0
+QString identity() = 0
+QIcon icon() = 0
+QString title() = 0
+bool isActive() = 0
+bool shouldSkip() = 0
+signals:
+void pidChanged()
+void identityChanged()
+void iconChanged()
+void titleChanged()
+void isActiveChanged()
+void shouldSkipChanged()
}
class TaskManager {
<<DContainment, AbstractTaskManagerInterface>>
+static const int WinIdRole
+static const int PidRole
+static const int IdentityRole
+static const int WinIconRole
+static const int WinTitleRole
+static const int ActiveRole
+static const int ShouldSkipRole
}
class AbstractWindowMonitor {
<<QAbstractListModel>>
+QHash<int, QByteArray> roleNames() const
+int rowCount(const QModelIndex &parent) const
+QVariant data(const QModelIndex &index, int role = TaskManager::WinIdRole) const
+void trackWindow(AbstractWindow* window)
+void destroyWindow(AbstractWindow * window)
-QList<AbstractWindow*> m_trackedWindows
}
AbstractWindowMonitor --> AbstractWindow : tracks
AbstractWindowMonitor ..> TaskManager : uses role constants
TaskManager <|.. AbstractTaskManagerInterface
TaskManager <|.. DContainment
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
此提交旨在为后续切换组合模型做准备,是原重构分支包含的部分变更. Log:
e4e8b71 to
cb20075
Compare
deepin pr auto review关键摘要:
是否建议立即修改:
|
18202781743
approved these changes
Jul 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
此提交旨在为后续切换组合模型做准备,是原重构分支包含的部分变更.
注意:
TaskManager::WinTitleRole的 roleName 和"globals.h"定义的名称不同(isActive/active)。暂未确认修改为MODEL_ACTIVE是否会对 QML 一侧产生影响。Summary by Sourcery
Refactor model role definitions to use TaskManager constants and global macros, remove the duplicate enum in AbstractWindow, and streamline header inclusions.
Enhancements:
Chores: