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: double value is converted to int for DConfig #451

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

18202781743
Copy link
Contributor

MetaType of 1.0 is qlonglong instead of double in json file.
We don't convert if source value is double.

deepin-ci-robot added a commit to linuxdeepin/dtk6core that referenced this pull request Dec 12, 2024
Synchronize source files from linuxdeepin/dtkcore.

Source-pull-request: linuxdeepin/dtkcore#451
kegechen
kegechen previously approved these changes Dec 12, 2024
MetaType of 1.0 is qlonglong instead of double in json file.
We don't convert if source value is double.
@18202781743 18202781743 requested a review from kegechen December 12, 2024 08:15
deepin-ci-robot added a commit to linuxdeepin/dtk6core that referenced this pull request Dec 12, 2024
Synchronize source files from linuxdeepin/dtkcore.

Source-pull-request: linuxdeepin/dtkcore#451
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • DConfigFilePrivate类中,对于value的类型转换使用了convert方法,但没有处理转换失败的情况。
  • filterConvertType向量中,硬编码了QMetaType::DoubleQVariant::Double,这可能会导致类型不匹配的问题。
  • 注释中提到了一个Qt的bug,但没有提供解决方案或者说明如何绕过这个问题。
  • 测试用例中新增了对numberDouble字段的测试,但没有检查转换后的值是否正确。

是否建议立即修改:

  • 应该立即修复类型转换失败的情况,确保代码的健壮性。
  • 需要重新评估filterConvertType向量中的类型,确保它们是正确的,并且不会因为类型不匹配而导致问题。
  • 对于Qt的bug,应该寻找解决方案或者提供替代方案,而不是仅仅在注释中提到。
  • 测试用例应该更加全面,确保所有可能的转换情况都被覆盖,并且检查转换后的值是否正确。

src/dconfigfile.cpp Outdated Show resolved Hide resolved
@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

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

@mhduiy mhduiy merged commit 951314d into linuxdeepin:master Dec 12, 2024
19 of 21 checks passed
mhduiy pushed a commit to linuxdeepin/dtk6core that referenced this pull request Dec 12, 2024
Synchronize source files from linuxdeepin/dtkcore.

Source-pull-request: linuxdeepin/dtkcore#451
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