feat: generate dconfig types using dconfig2cpp#363
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Jan 22, 2026
Merged
feat: generate dconfig types using dconfig2cpp#363deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
1. Added DtkTools dependency to dtkgui.cmake to support dconfig2cpp functionality 2. Modified kernel.cmake to use dtk_add_config_to_cpp() for automatic generation of OrgDeepinDTKPreference class 3. Removed manually maintained orgdeepindtkpreference.hpp file which was previously generated manually 4. The change enables automatic generation of DConfig wrapper classes from JSON configuration files during build process Log: Now using dconfig2cpp for automatic generation of DConfig types Influence: 1. Verify that the build system correctly generates orgdeepindtkpreference.hpp during compilation 2. Test that the generated class works correctly with DConfig functionality 3. Ensure all existing tests that use OrgDeepinDTKPreference continue to pass 4. Check that the generated header file contains all required properties and methods 5. Validate that DConfig value changes are properly propagated through the generated class feat: 使用 dconfig2cpp 自动生成 dconfig 类型 1. 在 dtkgui.cmake 中添加 DtkTools 依赖以支持 dconfig2cpp 功能 2. 修改 kernel.cmake 使用 dtk_add_config_to_cpp() 自动生成 OrgDeepinDTKPreference 类 3. 删除之前手动维护的 orgdeepindtkpreference.hpp 文件 4. 此更改使得在构建过程中能够从 JSON 配置文件自动生成 DConfig 包装类 Log: 现在使用 dconfig2cpp 自动生成 DConfig 类型 Influence: 1. 验证构建系统在编译过程中正确生成 orgdeepindtkpreference.hpp 2. 测试生成的类与 DConfig 功能正常工作 3. 确保所有使用 OrgDeepinDTKPreference 的现有测试继续通过 4. 检查生成的头文件包含所有必需的属性和方法 5. 验证 DConfig 值更改通过生成的类正确传播
Contributor
deepin pr auto reviewGit Diff 代码审查报告整体评估这次修改主要涉及构建系统的调整,将原本手动维护的 详细审查1. dtkgui.cmake 文件修改-find_package(Dtk${DTK_NAME_SUFFIX} REQUIRED Core)
+find_package(Dtk${DTK_NAME_SUFFIX} REQUIRED Core Tools)优点:
建议:
2. kernel.cmake 文件修改set(kernel_SRC
${KERNEL_HEADER}
${KERNEL_SOURCE}
- ${CMAKE_CURRENT_LIST_DIR}/orgdeepindtkpreference.hpp
)
+
+dtk_add_config_to_cpp(kernel_SRC /usr/share/dsg/configs/org.deepin.dtk.preference.json
+ OUTPUT_FILE_NAME orgdeepindtkpreference.hpp
+ CLASS_NAME OrgDeepinDTKPreference
+)优点:
问题和建议:
3. orgdeepindtkpreference.hpp 文件删除优点:
注意事项:
代码质量改进建议
安全性考虑
性能考虑
总结这次修改总体上是积极的,将手动维护的配置类替换为自动生成的代码,提高了可维护性和一致性。主要需要关注的是硬编码路径的问题,应该将其改为使用CMake变量,以提高灵活性和跨平台兼容性。此外,应该添加适当的依赖关系和错误处理,确保构建系统的健壮性。 |
zccrs
requested changes
Jan 22, 2026
zccrs
approved these changes
Jan 22, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
functionality
generation of OrgDeepinDTKPreference class
previously generated manually
from JSON configuration files during build process
Log: Now using dconfig2cpp for automatic generation of DConfig types
Influence:
orgdeepindtkpreference.hpp during compilation
functionality
to pass
and methods
the generated class
feat: 使用 dconfig2cpp 自动生成 dconfig 类型
OrgDeepinDTKPreference 类
Log: 现在使用 dconfig2cpp 自动生成 DConfig 类型
Influence: