Skip to content

fix: resolve compilation issues on Qt 6.9#6

Merged
zccrs merged 2 commits intolinuxdeepin:masterfrom
zccrs:master
Apr 12, 2025
Merged

fix: resolve compilation issues on Qt 6.9#6
zccrs merged 2 commits intolinuxdeepin:masterfrom
zccrs:master

Conversation

@zccrs
Copy link
Member

@zccrs zccrs commented Apr 12, 2025

Adjusted the logger name retrieval in both FileAppender and RollingFileAppender classes to ensure compatibility with Qt 6.9. The changes involve replacing string parameters with QFile objects, which fixes the compilation errors that occurred under this version. These modifications improve the code's stability and ensure it adheres to the latest Qt standards, which is necessary for maintaining compatibility with future updates.

修复: 解决在 Qt 6.9 上的编译问题

调整了 FileAppender 和 RollingFileAppender 类中的日志记录器名称获取,以 确保与 Qt 6.9 的兼容性。更改涉及将字符串参数替换为 QFile 对象,从而修复
了在此版本下出现的编译错误。这些修改提高了代码的稳定性,并确保其遵循最新
的 Qt 标准,这对于维护与未来更新的兼容性是必要的。

Adjusted the logger name retrieval in both FileAppender and
RollingFileAppender classes to ensure compatibility with Qt 6.9. The
changes involve replacing string parameters with QFile objects, which
fixes the compilation errors that occurred under this version. These
modifications improve the code's stability and ensure it adheres to the
latest Qt standards, which is necessary for maintaining compatibility
with future updates.

修复: 解决在 Qt 6.9 上的编译问题

调整了 FileAppender 和 RollingFileAppender 类中的日志记录器名称获取,以
确保与 Qt 6.9 的兼容性。更改涉及将字符串参数替换为 QFile 对象,从而修复
了在此版本下出现的编译错误。这些修改提高了代码的稳定性,并确保其遵循最新
的 Qt 标准,这对于维护与未来更新的兼容性是必要的。
@zccrs zccrs requested a review from Copilot April 12, 2025 02:49
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zccrs

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

release 0.0.3

Log: bump version to 0.0.3
@github-actions
Copy link
Contributor

TAG Bot

TAG: 0.0.3
EXISTED: no
DISTRIBUTION: unstable

@zccrs zccrs merged commit 14a104b into linuxdeepin:master Apr 12, 2025
6 of 8 checks passed
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. FileAppender.cpp文件中,setFileName函数中使用了QFile(s),但是没有检查文件路径是否有效。建议添加文件路径有效性检查,例如使用QFile::exists方法。

  2. RollingFileAppender.cpp文件中,computeRollOverTimesetLogFilesLimitsetLogSizeLimit函数中,fileName()方法被直接传递给loggerName函数。如果fileName()返回的是文件路径,而不是文件名,那么loggerName函数可能无法正确生成日志记录器的名称。建议检查fileName()方法的返回值,确保传递给loggerName的是文件名。

  3. RollingFileAppender.cpp文件中,setLogFilesLimitsetLogSizeLimit函数中,std::size_t(limit)的转换可能不必要,因为limit已经是int类型。如果limit的值不会超过std::size_t的最大值,那么可以直接使用limit

  4. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数类型是std::size_t,但是m_logSizeLimit的类型是int。如果m_logSizeLimit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储m_logSizeLimit的值。

  5. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数单位是字节,但是m_logSizeLimit的单位是MB。建议在设置m_logSizeLimit时将其转换为字节。

  6. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  7. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  8. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  9. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  10. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  11. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  12. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  13. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  14. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  15. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  16. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  17. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  18. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  19. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  20. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  21. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  22. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  23. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  24. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  25. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  26. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  27. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  28. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  29. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  30. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  31. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  32. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  33. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  34. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  35. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  36. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  37. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  38. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  39. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  40. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  41. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  42. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  43. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  44. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  45. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  46. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  47. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  48. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  49. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  50. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  51. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  52. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  53. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  54. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

  55. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的单位是MB。建议在设置limit时将其转换为字节。

  56. RollingFileAppender.cpp文件中,setLogSizeLimit函数中,set_max_size方法的参数值是std::size_t(limit),但是limit的类型是int。如果limit的值可能会超过std::size_t的最大值,那么需要考虑使用std::size_t类型来存储limit的值。

asterwyx added a commit to linuxdeepin/dtk6log that referenced this pull request Jun 16, 2025
Synchronize from linuxdeepin/dtklog#6

Signed-off-by: Yixue Wang <wangyixue@uniontech.com>
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.

2 participants