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: crash on treeland #378

Merged
merged 1 commit into from
Dec 6, 2024
Merged

fix: crash on treeland #378

merged 1 commit into from
Dec 6, 2024

Conversation

wineee
Copy link
Member

@wineee wineee commented Dec 6, 2024

No description provided.

@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • halfScreenSize函数中添加了对screen指针的空值检查,这是一个好的做法,可以避免潜在的空指针解引用问题。
  • 使用qCritical输出错误信息是一个合适的做法,可以帮助开发者快速定位问题。

是否建议立即修改:

  • 否,提交的代码没有明显的错误,但是可以提出一些改进建议以提高代码质量和可读性。

建议的改进:

  • 考虑在错误处理时,除了输出错误信息外,还可以考虑记录日志或者抛出异常,以便于后续的错误追踪和处理。
  • 可以添加注释来解释为什么需要检查screen指针是否为空,以及当screen为空时返回QSize(0, 0)的原因。
  • 如果halfScreenSize函数可能会被频繁调用,可以考虑缓存屏幕尺寸信息,以减少对QGuiApplication::screenAt的调用次数,提高性能。

Copy link
Contributor

@ArchieMeng ArchieMeng left a comment

Choose a reason for hiding this comment

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

+1

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ArchieMeng, wineee

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

@ArchieMeng ArchieMeng merged commit 3fabbe4 into linuxdeepin:master Dec 6, 2024
9 of 12 checks passed
@wineee wineee deleted the fix branch December 6, 2024 07: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