-
Notifications
You must be signed in to change notification settings - Fork 48
fix: prevent duplicate dock requests #1204
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
1. Added check for existing docked applications in requestDockByDesktopId 2. Return false if application is already docked to avoid duplicate entries 3. Improves user experience by preventing redundant dock requests 4. Maintains cleaner taskbar state by avoiding duplicate icons fix: 防止重复的dock请求 1. 在requestDockByDesktopId中添加对已dock应用的检查 2. 如果应用已经dock则返回false避免重复条目 3. 通过防止冗余的dock请求提升用户体验 4. 避免重复图标保持任务栏状态更整洁 Pms: BUG-315721
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.
Reviewer's GuideReworks requestDockByDesktopId to check for existing docked applications before docking, returning false to prevent duplicate entries and redundant taskbar icons. Sequence diagram for preventing duplicate dock requestssequenceDiagram
actor User
participant TaskManager
participant Taskbar
User->>TaskManager: requestDockByDesktopId(desktopID)
TaskManager->>TaskManager: desktopIdToAppId(desktopID)
TaskManager->>TaskManager: IsDocked(appId)?
alt Already docked
TaskManager-->>User: return false
else Not docked
TaskManager->>TaskManager: RequestDock(appId)
TaskManager-->>User: return result
end
Class diagram for TaskManager dock request logic updateclassDiagram
class TaskManager {
+bool requestDockByDesktopId(QString desktopID)
-QString desktopIdToAppId(QString desktopID)
-bool IsDocked(QString appId)
-bool RequestDock(QString appId)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review代码审查意见:
综合以上意见,代码可以修改如下: bool TaskManager::requestDockByDesktopId(const QString& desktop_id)
{
if (desktop_id.startsWith("internal/")) return false;
QString app_id = desktopIdToAppId(desktop_id);
// 检查应用是否已经在任务栏中,如果是则返回 false
if (IsDocked(app_id))
return false;
return RequestDock(app_id);
} 以上修改提高了代码的可读性、可维护性和性能。 |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia, wjyrich 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 |
/forcemerge |
This pr force merged! (status: unstable) |
fix: 防止重复的dock请求
Pms: BUG-315721
Summary by Sourcery
Prevent duplicate dock requests in TaskManager by adding a check for existing docked applications and returning false if already docked
Bug Fixes:
Enhancements: