Skip to content

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented May 21, 2025

AbstractWindowMonitor 在跟踪移除窗口事件时,对 model 状态的维护不正确, 实际移除的元素数量和beginRemoveRows中传递的数量不匹配,可能导致模型状态有误导致的潜在崩溃或视图错误.

Summary by Sourcery

Bug Fixes:

  • Correct the end index for beginRemoveRows to match the single removed row, avoiding mismatches between actual removals and reported ranges.

@BLumia BLumia requested review from 18202781743 and tsic404 May 21, 2025 05:32
@sourcery-ai
Copy link

sourcery-ai bot commented May 21, 2025

Reviewer's Guide

The PR corrects the row removal notification in AbstractWindowMonitor’s destroyWindow method by matching the beginRemoveRows range to the actual single-element removal, avoiding model/view inconsistencies.

File-Level Changes

Change Details Files
Fixed incorrect row removal range in model notifications
  • Adjusted beginRemoveRows end index from pos+1 to pos
panels/dock/taskmanager/abstractwindowmonitor.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @BLumia - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

AbstractWindowMonitor 在跟踪移除窗口事件时,对 model 状态的维护不正确,
实际移除的元素数量和beginRemoveRows中传递的数量不匹配,可能导致模型状态
有误导致的潜在崩溃或视图错误.

另外,也将原本的 removeOne 调整为 removeAt,以便准确移除给定位置的元素,
而非首个匹配但不一定在给定位置的元素.

Log:
@BLumia BLumia force-pushed the beginremoverows branch from 0f20237 to 41e37b4 Compare May 21, 2025 05:44
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • beginRemoveRowsendRemoveRows 的参数在修改后不一致,可能导致数据模型更新错误。
  • m_trackedWindows.removeAt(pos) 应该使用 removeAt 而不是 removeOne,因为 removeOne 会移除所有匹配的元素,而 removeAt 只移除指定位置的元素。

是否建议立即修改:

@deepin-ci-robot
Copy link

@BLumia: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
deepin-auto-translation 41e37b4 link true /test deepin-auto-translation

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, tsic404

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@BLumia BLumia merged commit 15268e9 into linuxdeepin:master May 21, 2025
8 of 11 checks passed
@BLumia BLumia deleted the beginremoverows branch May 21, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants