-
Notifications
You must be signed in to change notification settings - Fork 55
fix: Fix error in obtaining resident app status #1370
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
Fix error in obtaining resident app status Log: Fix error in obtaining resident app status pms: BUG-343145
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors docked-status retrieval in TaskManager to query the desktop file parser directly for resident app status, avoiding potential null QPointer access and aligning with the parser’s API. Sequence diagram for updated docked-status retrieval in TaskManager::IsDockedsequenceDiagram
participant TaskManager
participant DesktopFileParser
TaskManager->>DesktopFileParser: isDocked(appID)
DesktopFileParser-->>TaskManager: bool isDocked
Note over TaskManager,DesktopFileParser: QPointer<AppItem> and AppItem::isDocked are no longer used directly
Updated class diagram for docked-status retrieval in TaskManagerclassDiagram
class TaskManager {
+bool IsDocked(QString appID)
+bool RequestUndock(QString appID)
}
class DesktopFileParser {
+bool isDocked()
+QPointer~AppItem~ getAppItem()
}
class AppItem {
+bool isDocked()
}
TaskManager --> DesktopFileParser : uses
DesktopFileParser --> AppItem : provides
%% Change: TaskManager::IsDocked now calls DesktopFileParser::isDocked directly
%% instead of retrieving AppItem via getAppItem and calling AppItem::isDocked
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码变更看起来是一个重构优化,我来详细分析一下:
建议:
总的来说,这是一个很好的重构,提高了代码的可维护性和可读性,同时保持了相同的功能。 |
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.
Hey there - I've reviewed your changes - here's some feedback:
- Given the previous null check on
getAppItem(), ensure thatDesktopfileParser::isDocked()gracefully handles cases where the underlying app item or metadata is missing or invalid so that behavior remains consistent (e.g., returningfalseinstead of crashing or throwing).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Given the previous null check on `getAppItem()`, ensure that `DesktopfileParser::isDocked()` gracefully handles cases where the underlying app item or metadata is missing or invalid so that behavior remains consistent (e.g., returning `false` instead of crashing or throwing).Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, pengfeixx 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 |
Fix error in obtaining resident app status
Log: Fix error in obtaining resident app status
pms: BUG-343145
Summary by Sourcery
Bug Fixes: