-
Notifications
You must be signed in to change notification settings - Fork 57
feat: generate dconfig types using dconfig2cpp #363
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
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 值更改通过生成的类正确传播
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变量,以提高灵活性和跨平台兼容性。此外,应该添加适当的依赖关系和错误处理,确保构建系统的健壮性。 |
|
[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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
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: