Skip to content

pick v20 to v25#780

Merged
deepin-bot[bot] merged 4 commits into
linuxdeepin:develop/snipefrom
add-uos:develop/snipe
Dec 16, 2025
Merged

pick v20 to v25#780
deepin-bot[bot] merged 4 commits into
linuxdeepin:develop/snipefrom
add-uos:develop/snipe

Conversation

@add-uos

@add-uos add-uos commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

pick v20 to v25

Add CPU architecture information to system debug output, for more
convenient for tracing platform-related issues

Log: Add CPU architecture information to system debug output
Bug: https://pms.uniontech.com/bug-view-326039.html
add the scroll-screenshot image check.

pick from: a81ec1c

Log: add the scroll-screenshot image check.
Bug: https://pms.uniontech.com//bug-view-314667.html
fix the scroll screen shot crush start in high dpi.

pick from 66b8af0

Log: fix the scroll screen shot crush start in high dpi.
Bug: https://pms.uniontech.com//bug-view-320615.html
fix screenshot save path check incorrect

Log: fix screenshot save path check incorrect
Bug: https://pms.uniontech.com/bug-view-319087.html
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

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

  1. main_window.cpp 中的修改:
  • 优点:将QDir改为QFileInfo更合理,因为我们需要检查的是文件路径的目录是否存在,而不是直接检查路径本身是否为目录。
  • 优点:在处理鼠标坐标时统一乘以m_pixelRatio,这样可以确保在高DPI显示下坐标计算准确。
  • 建议:在wheelEvent和wheelEF函数中,可以考虑将鼠标坐标计算封装成一个单独的函数,避免代码重复。
  1. utils.cpp 中的修改:
  • 优点:添加了CPU架构信息的日志输出,有助于调试和问题定位。
  • 建议:可以考虑将这些系统信息收集到一个单独的函数中,便于统一管理和维护。
  1. pixmergethread.cpp 中的修改:
  • 优点:
    • 添加了图像有效性检查,提高了代码的健壮性
    • 将cv::Vec3b改为cv::Vec4b以支持ARGB格式
    • 添加了越界保护
    • 改进了错误处理和日志输出
  • 建议:
    • 在getScrollChangeRectArea函数中,可以考虑添加图像尺寸差异的容错处理
    • 可以考虑将图像格式检查和转换封装成单独的工具函数
    • 对于返回QRect(-1, -1, -1, -1)的情况,建议定义一个常量来表示无效矩形
  1. 代码安全方面:
  • 建议在处理图像数据时添加更多的边界检查
  • 建议对用户输入的路径参数进行规范化处理,防止路径遍历攻击
  1. 性能方面:
  • 图像处理循环可以考虑使用OpenCV的并行处理功能
  • 对于大尺寸图像,可以考虑使用分块处理的方式减少内存占用
  1. 代码质量方面:
  • 建议统一使用qCDebug或qWarning,避免混用
  • 建议为关键函数添加更详细的注释说明
  • 可以考虑将一些魔法数字定义为常量

总体来说,这些修改提高了代码的健壮性和可维护性,特别是在图像处理和坐标计算方面。建议继续完善错误处理机制,并考虑性能优化。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos, lzwind

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

@add-uos

add-uos commented Dec 16, 2025

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot deepin-bot Bot merged commit 49e478f into linuxdeepin:develop/snipe Dec 16, 2025
9 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