Skip to content

Conversation

@wjyrich
Copy link
Contributor

@wjyrich wjyrich commented Oct 24, 2025

文管采用了相关脚本处理,无需dde-shell特殊处理回收站,只需保持原有逻辑。

Logs:

Summary by Sourcery

Revert custom trash handling in TaskManager and restore original drop behavior

Enhancements:

  • Remove special-case handling for 'dde-trash' in dropFilesOnItem and associated moveFilesToTrash logic
  • Remove DTrashManager include and moveFilesToTrash private method now that file manager scripts handle trash operations

文管采用了相关脚本处理,无需dde-shell特殊处理回收站,只需保持原有逻辑。

Logs:
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich

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

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 24, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR reverts the custom trash-handling additions in TaskManager by removing the special-case branch in dropFilesOnItem, deleting the moveFilesToTrash helper, and cleaning up related unused imports.

Class diagram for TaskManager after trash-handling revert

classDiagram
class TaskManager {
    +void saveDockElementsOrder(QStringList appIds)
    +QString getTrashTipText()
    +void dropFilesOnItem(QString itemId, QStringList urls)
    +void handleWindowAdded(QPointer<AbstractWindow> window)
    +void hideItemPreview()
    <<signals>>
    +void dataModelChanged()
    +void windowSplitChanged()
}
Loading

File-Level Changes

Change Details Files
Revert dropFilesOnItem custom trash branch
  • Removed the if (itemId == "dde-trash") block and early return
  • Restored original dropFilesOnItem flow for handling file drops
panels/dock/taskmanager/taskmanager.cpp
Remove moveFilesToTrash helper method
  • Deleted moveFilesToTrash implementation
  • Removed its private declaration from the header
panels/dock/taskmanager/taskmanager.cpp
panels/dock/taskmanager/taskmanager.h
Clean up unused imports
  • Removed QDir include
  • Removed DTrashManager include
panels/dock/taskmanager/taskmanager.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 there - I've reviewed your changes and they look great!


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.

@deepin-ci-robot
Copy link

deepin pr auto review

我来分析一下这个代码变更:

  1. 代码变更内容:
  • 移除了与回收站(trash)相关的功能代码
  • 删除了 moveFilesToTrash 函数及其声明
  • 删除了相关的头文件引用(QDir 和 DTrashManager)
  • 移除了在 dropFilesOnItem 函数中处理回收站的逻辑
  1. 改进建议:

语法逻辑:

  • 代码变更在语法上是正确的,没有引入语法错误
  • 移除了未使用的头文件,符合良好的编程实践

代码质量:

  • 移除特定功能(回收站)是合理的,因为这可能是为了简化代码或重构功能
  • 删除了未使用的私有函数 moveFilesToTrash,提高了代码的整洁性
  • 建议:如果回收站功能被移除,应该确保这个功能不会在其他地方被调用,否则可能导致运行时错误

代码性能:

  • 移除了不必要的文件操作代码,可能会略微提升性能
  • 删除了未使用的头文件,可以减少编译时间

代码安全:

  • 移除了文件操作相关的代码,降低了潜在的安全风险
  • 建议:如果回收站功能确实被移除,建议在代码注释中说明原因,以便其他开发者理解这个变更
  1. 其他建议:
  • 建议在删除功能时添加相关的注释说明
  • 如果这个功能被移动到其他地方,建议在代码中添加相应的引用说明
  • 建议检查是否有其他代码依赖这些被删除的功能,确保不会破坏现有功能

总体来说,这个代码变更是合理的,它简化了代码结构,移除了特定功能。但建议确保这个变更不会影响其他部分的代码功能。

Copy link
Contributor

@18202781743 18202781743 left a comment

Choose a reason for hiding this comment

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

直接使用git的revert不能么?

@wjyrich wjyrich closed this Oct 24, 2025
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.

3 participants