Skip to content

Conversation

@pppanghu77
Copy link

Renamed functions and updated logic to improve clarity and consistency in handling long file names across the codebase. The function isSubpathOfDlnfs is now isSubpathOfLnfs, and findDlnfsPath has been changed to findLnfsPath. This refactoring enhances the readability of the code and ensures that the correct file system types are checked for long file name support.

Log: Refactor long file name handling in common interface

Bug: https://pms.uniontech.com/bug-view-326015.html

Renamed functions and updated logic to improve clarity and consistency in handling long file names across the codebase. The function `isSubpathOfDlnfs` is now `isSubpathOfLnfs`, and `findDlnfsPath` has been changed to `findLnfsPath`. This refactoring enhances the readability of the code and ensures that the correct file system types are checked for long file name support.

Log: Refactor long file name handling in common interface

Bug: https://pms.uniontech.com/bug-view-326015.html
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pppanghu77

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

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 变量命名一致性

    • Common类中,isSubpathOfDlnfs函数被重命名为isSubpathOfLnfs,但其他相关函数和变量(如bDlnfsbLnfs)并没有相应更新,可能会导致混淆。建议统一命名,保持一致性。
  2. 代码重复

    • CliInterface::extractFilesLibarchivePlugin::extractFiles中,bDlnfs被替换为bLnfs,但这两个函数中处理bLnfs的逻辑是相同的。建议提取公共逻辑到一个单独的函数中,以减少代码重复。
  3. 错误处理

    • Common::findDlnfsPath函数中,mnt_free_tablemnt_free_iter的调用应该放在if语句之外,以确保在函数结束时都能正确释放资源,避免内存泄漏。
  4. 字符串比较

    • Common::findDlnfsPath中,使用strcmp来比较文件系统类型时,应该使用QString::compare方法,以避免与C风格字符串比较的潜在问题。
  5. 文件系统类型检查

    • UiTools::isLocalDeviceFile函数中,增加了对文件系统类型的检查,这是一个好的做法,可以更准确地判断文件是否属于本地设备。建议在代码中添加注释,说明为什么需要检查文件系统类型。
  6. 代码注释

    • CliInterface::extractFilesLibarchivePlugin::extractFilesLibzipPlugin::extractFiles中,bDlnfs被替换为bLnfs后,建议更新相应的注释,以反映变量名的变化。
  7. 逻辑清晰性

    • CliInterface::extractFilesLibarchivePlugin::extractFiles中,bLnfs的检查逻辑是相同的,但代码风格不一致。建议统一代码风格,使代码更易于阅读和维护。
  8. 函数参数命名

    • CliInterface::extractFilesLibarchivePlugin::extractFiles中,函数参数bDlnfs被替换为bLnfs,但函数参数名没有相应更新。建议保持参数名的一致性,以避免混淆。

总体来说,代码的修改是合理的,但需要注意保持命名和逻辑的一致性,以及避免代码重复和潜在的错误。

@pppanghu77
Copy link
Author

/merge

@deepin-bot deepin-bot bot merged commit ac46223 into linuxdeepin:release/eagle Jul 28, 2025
14 checks passed
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