Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide btn and fix rotate issue #204

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

rb-union
Copy link
Contributor

@rb-union rb-union commented Dec 11, 2024

Hide prevoius / next button when only single image.

Log: Hide btn when only single image.
Bug: https://pms.uniontech.com/bug-view-290687.html
Influence: UI

fix: can not rotate after rename
We add a new source model in the previous changes,
which not sync the name change, fix it.

Log: Fix can not rotate after rename.
Bug: https://pms.uniontech.com/bug-view-275403.html

Hide prevoius / next button when only single image.

Log: Hide btn when only single image.
Bug: https://pms.uniontech.com/bug-view-290687.html
Influence: UI
We add a new source model in the previous changes,
which not sync the name change, fix it.

Log: Fix can not rotate after rename.
Bug: https://pms.uniontech.com/bug-view-275403.html
@rb-union rb-union changed the title fix: hide btn when only single image fix: hide btn and fix rotate issue Dec 12, 2024
@rb-union rb-union closed this Dec 12, 2024
@rb-union rb-union reopened this Dec 12, 2024
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. main.cpp文件中,QObject::connect的lambda表达式捕获了fileControlstatus对象,但没有使用std::move来避免潜在的复制问题。如果fileControlstatus对象较大,可以考虑使用std::move来避免不必要的复制。

  2. BaseImageDelegate.qml文件中,targetImage.paintedWidth > 0的检查应该放在if (targetImage)的内部,以避免在targetImage为空时访问其成员变量。

  3. NormalImageDelegate.qml文件中,updateSource函数被调用时没有检查其返回值,如果updateSource返回false,可能会导致后续代码执行错误。

  4. ViewDelegateLoader.qml文件中,source属性绑定到pathViewItemLoader.imageUrl,但是pathViewItemLoaderimageUrl属性被标记为required,这意味着在使用ViewDelegateLoader时必须提供imageUrl。这可能会导致在使用ViewDelegateLoader时出现错误。

  5. GlobalControl.cpp文件中,renameImage函数在重命名图片后,没有检查viewSourceModel是否为空,直接对其调用setData方法。如果viewSourceModel为空,这可能会导致程序崩溃。

  6. ImageInfoCache.cpp文件中,ImageInfoCache的析构函数没有释放cache中的QImage对象,这可能会导致内存泄漏。

  7. ProviderCache.cpp文件中,removeImageCache函数在遍历imageCache时,没有使用std::move来避免不必要的复制。

  8. ThumbnailCache.cpp文件中,take函数在获取cache中的QImage对象后,没有检查image是否为空,直接返回。这可能会导致返回一个空的QImage对象。

  9. UnionImage.cpp文件中,rotateImageFile函数在保存旋转后的图像时,没有检查image_copy.save的返回值,直接返回。这可能会导致保存图像失败时没有给出错误提示。

  10. UnionImage.cpp文件中,detectImageFormat函数在返回文件格式时,没有检查文件是否支持,直接返回文件后缀。这可能会导致返回不支持的文件格式。

  11. RotateImageHelper.cpp文件中,rotateImageImpl函数在复制文件到缓存目录时,没有检查QFile::copy的返回值,直接返回。这可能会导致复制文件失败时没有给出错误提示。

以上是代码审查的一些主要意见,具体的改进措施需要根据代码的具体实现和业务逻辑来决定。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pengfeixx, rb-union

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

Copy link

@myk1343 myk1343 left a comment

Choose a reason for hiding this comment

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

[是否满足兼容性要求] Y
[是否满足commit提交规范] Y
[是否满足编码规范] Y
[Review结论] Pass
[Fail原因] N/A

@rb-union rb-union merged commit 7b402b3 into linuxdeepin:master Dec 12, 2024
33 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