Skip to content

Conversation

@wangrong1069
Copy link
Contributor

@wangrong1069 wangrong1069 commented Dec 5, 2025

Added "ulnfs" to the list of filesystems supporting long filenames in FileUtils::supportLongName().

Task: https://pms.uniontech.com/task-view-381255.html

Summary by Sourcery

Bug Fixes:

  • Treat ulnfs filesystems as supporting long filenames in FileUtils::supportLongName().

Added "ulnfs" to the list of filesystems supporting long filenames in
FileUtils::supportLongName().

Task: https://pms.uniontech.com/task-view-381255.html
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 5, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Extend FileUtils::supportLongName() so that ULNFS-mounted paths are treated as supporting long filenames by including the "ulnfs" filesystem type in its internal whitelist.

Class diagram for FileUtils::supportLongName long-filename filesystem update

classDiagram
    class FileUtils {
        +QString normalPathToTrash(QUrl normal)
        +bool supportLongName(QUrl url)
        -static QList~QString~ longNameFsTypes
    }

    class dfmio_DFMUtils {
        +static QString fsTypeFromUrl(QUrl url)
    }

    FileUtils ..> dfmio_DFMUtils : uses

    %% Updated internal whitelist now includes ulnfs
    class longNameFsTypes {
        +vfat
        +exfat
        +ntfs
        +ntfs3
        +fuseblk
        +fuse.dlnfs
        +udf
        +ulnfs
    }

    FileUtils *-- longNameFsTypes : contains
Loading

File-Level Changes

Change Details Files
Extend the set of filesystem types considered to support long filenames to include ULNFS.
  • Updated the static list of filesystem identifiers in FileUtils::supportLongName() to append the "ulnfs" type.
  • Left existing supported filesystem entries (vfat, exfat, ntfs, ntfs3, fuseblk, fuse.dlnfs, udf) unchanged, preserving current behavior.
src/dfm-base/utils/fileutils.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
Contributor

deepin pr auto review

我来对这段代码的修改进行审查:

  1. 语法逻辑:
  • 修改是在静态QList中添加了一个新的文件系统类型"ulnfs"
  • 语法上没有问题,使用const static确保了列表只初始化一次
  • 代码格式符合规范
  1. 代码质量:
  • 使用const static是好的实践,避免了重复初始化
  • 变量命名清晰,datas和fileSystem都能清楚表达用途
  • 建议将datas重命名为更具体的名称,如supportedFileSystems,以提高可读性
  1. 代码性能:
  • 使用const static确保列表只初始化一次,性能良好
  • 查找操作使用QList的contains方法,时间复杂度为O(n)
  • 如果这个列表会继续增长,建议考虑使用QSet来提高查找效率,将时间复杂度降为O(1)
  1. 代码安全:
  • 修改本身是安全的,只是添加了一个新的文件系统类型支持
  • 建议添加注释说明"ulnfs"文件系统的具体用途,方便其他开发者理解

改进建议:

  1. 将变量名改为更具描述性的名称:
const static QList<QString> supportedFileSystems {
    "vfat", "exfat", "ntfs", "ntfs3", "fuseblk", "fuse.dlnfs", "udf", "ulnfs"
};
  1. 如果查找性能是关键,考虑使用QSet:
const static QSet<QString> supportedFileSystems {
    "vfat", "exfat", "ntfs", "ntfs3", "fuseblk", "fuse.dlnfs", "udf", "ulnfs"
};
  1. 添加注释说明新增文件系统的用途:
// ulnfs: User Level Network File System support
const static QList<QString> supportedFileSystems {
    // ... other file systems ...
    "ulnfs"
};

总的来说,这个修改是合理的,主要是增加了对新文件系统类型的支持。建议的改进主要是为了提高代码的可维护性和性能。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Johnson-zs, wangrong1069

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangrong1069
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Dec 5, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 3b5b00a into linuxdeepin:master Dec 5, 2025
19 of 21 checks passed
@wangrong1069 wangrong1069 deleted the pr1205 branch December 5, 2025 03:34
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