Skip to content

pick v20 -v25#412

Merged
deepin-bot[bot] merged 7 commits intolinuxdeepin:masterfrom
pppanghu77:master
Dec 18, 2025
Merged

pick v20 -v25#412
deepin-bot[bot] merged 7 commits intolinuxdeepin:masterfrom
pppanghu77:master

Conversation

@pppanghu77
Copy link
Contributor

No description provided.

pppanghu77 and others added 7 commits December 18, 2025 17:17
Commented out QSaveFile usage in the save method due to issues with file permissions in certain cases. The code now directly uses QFile for saving files. This change is intended to address potential problems with long filenames and ensure smoother file saving operations.

Log: Temporarily disable QSaveFile in TextFileSaver to prevent permission issues.
Bug: https://pms.uniontech.com/bug-view-327987.html
After invoking QTimer, it is necessary to check if "this" has been destroyed before accessing its members to avoid null pointer exceptions.

fix: QTimer调用后的空指针异常

QTimer调用后,需要判断this是否已经被销毁,然后再使用this的成员,避免空指针异常。

Bug: https://pms.uniontech.com/bug-view-329587.html
When the application starts, it needs to first determine whether to restore tabs.

fix: 不保留标签页功能未生效。

应用启动的时候,需要先判断是否需要恢复标签页。
不保留标签页功能未生效,因为历史上的一条提交引入了错误代码导致提前返回了,导致历史文件记录没有被清空。
revert 9ce896a.

Bug: https://pms.uniontech.com/bug-view-341299.html
调整关闭窗口时保存文件的逻辑。
在【保留关闭前的页签】勾选后,普通情况下不提醒保存文件,当本地文件被重命名或删除时提醒保存文件,以确保文件不丢失。

Bug: https://pms.uniontech.com/bug-view-315439.html
调整关闭窗口时对草稿文件的处理。
初次开启的草稿文件,因为还没有落盘,所以获取到的文件路径为空,此时不应该返回false,而应该继续循环。

Bug: https://pms.uniontech.com/bug-view-315439.html
按照DDE的要求,setDocName()函数中传入的字符串不能是绝对路径也不带扩展名。
Revert b85b9d2.

Bug: https://pms.uniontech.com/bug-view-329561.html https://pms.uniontech.com/bug-view-329547.html
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.

Sorry @pppanghu77, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这段代码进行审查和分析:

  1. text_file_saver.cpp 的修改:
  • 代码安全:禁用QSaveFile可能会降低文件写入的安全性,因为QSaveFile提供了原子写入保护。建议:
    • 可以考虑添加一个配置选项让用户选择是否使用QSaveFile
    • 或者只对特定权限要求的文件禁用QSaveFile
  • 代码质量:移除了过多的调试输出(qDebug),这是好的改进
  • 建议:保留文件名长度检查的逻辑,但可以简化实现
  1. editwrapper.cpp 的修改:
  • 代码安全:使用QPointer检查对象生命周期的改进很好,避免了潜在的悬空指针问题
  • 代码质量:代码结构更清晰,错误处理更完善
  • 建议:可以考虑将lambda表达式提取为单独的成员函数,提高代码可读性
  1. startmanager.cpp 的修改:
  • 代码质量:移除了不必要的空窗口检查,简化了逻辑
  • 建议:添加的日志信息有助于调试,很好
  1. window.cpp 的修改:
  • 代码逻辑:
    • saveAllFiles() 改名为 saveAllFloatingFiles() 更准确地反映了函数功能
    • 改进了文件保存逻辑,特别是对草稿文件的处理
    • 打印对话框的文档名称处理更合理
  • 代码安全:
    • 增加了对文件存在性的检查
    • 改进了关闭窗口时的文件保存逻辑
  • 建议:
    • 可以考虑将saveAllFloatingFiles()中的保存逻辑进一步拆分成更小的函数
    • 文件路径处理可以统一使用QFileInfo
  1. 整体建议:
  • 错误处理:建议统一错误处理机制,比如使用统一的错误码或异常处理
  • 日志:建议统一日志级别和格式
  • 代码复用:一些文件操作逻辑可以提取为公共函数
  • 测试:建议增加单元测试,特别是文件保存相关的功能

这些修改总体上是积极的,提高了代码的健壮性和可维护性。主要关注点是文件操作的安全性和错误处理的完整性。

@github-actions
Copy link

  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "src/widgets/window.cpp": [
        {
            "line": "    QString key = \"base/enable\";",
            "line_number": 389,
            "rule": "S106",
            "reason": "Var naming | 64f28539d9"
        }
    ]
}

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, 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

@pppanghu77
Copy link
Contributor Author

/merge

@deepin-bot deepin-bot bot merged commit 5cd3fcb into linuxdeepin:master Dec 18, 2025
17 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.

4 participants