-
Notifications
You must be signed in to change notification settings - Fork 55
chore: use roles defined in TaskManager class #1198
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
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此提交旨在为后续切换组合模型做准备,是原重构分支包含的部分变更. Log:
e4e8b71 to
cb20075
Compare
deepin pr auto review关键摘要:
是否建议立即修改:
|
此提交旨在为后续切换组合模型做准备,是原重构分支包含的部分变更.
注意:
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: