Skip to content

适配dconfig2cpp - #309

Merged
zccrs merged 2 commits into
linuxdeepin:masterfrom
zccrs:master
Apr 25, 2025
Merged

适配dconfig2cpp#309
zccrs merged 2 commits into
linuxdeepin:masterfrom
zccrs:master

Conversation

@zccrs

@zccrs zccrs commented Mar 6, 2025

Copy link
Copy Markdown
Member

使用异步方式读写DConfig配置

@zccrs
zccrs requested a review from 18202781743 March 6, 2025 13:28
deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Mar 6, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#309
@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor
  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "src/kernel/dguiapplicationhelper.cpp": [
        {
            "line": "    QString socket_key = \"_d_dtk_single_instance_\";",
            "line_number": 1468,
            "rule": "S106",
            "reason": "Var naming | 2ad926d35b"
        }
    ]
}

deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Mar 6, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#309
@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor
  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "src/kernel/dguiapplicationhelper.cpp": [
        {
            "line": "    QString socket_key = \"_d_dtk_single_instance_\";",
            "line_number": 1468,
            "rule": "S106",
            "reason": "Var naming | 2ad926d35b"
        }
    ]
}

deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Mar 6, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#309
@zccrs

zccrs commented Mar 6, 2025

Copy link
Copy Markdown
Member Author

@18202781743 这个提交的功能需要你验证下

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

代码审查意见:

  1. dguiapplicationhelper.cpp文件中,Q_GLOBAL_STATIC宏的使用方式有误。Q_GLOBAL_STATIC宏需要两个参数:第一个是静态变量的类型,第二个是静态变量的名称。在代码中,_d_dconfig被定义为Q_GLOBAL_STATIC_WITH_ARGS,这可能是为了传递额外的参数给静态变量的构造函数。但是,Q_GLOBAL_STATIC_WITH_ARGS宏的使用方式不正确,应该使用Q_GLOBAL_STATIC宏,并在静态变量的定义中直接传递参数。

  2. dguiapplicationhelper.cpp文件中,_d_dconfig的连接信号槽的方式有误。在连接信号槽时,应该使用QObject::connect函数,而不是operator()函数。operator()函数不是QObject类的成员函数,因此不能用于连接信号槽。

  3. dplatformtheme.cpp文件中,dtkPreferenceConfig的连接信号槽的方式有误。在连接信号槽时,应该使用QObject::connect函数,而不是operator()函数。operator()函数不是QObject类的成员函数,因此不能用于连接信号槽。

  4. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,DConfig::createGeneric函数的使用方式有误。DConfig::createGeneric函数需要四个参数:第一个是DConfigBackend指针,第二个是配置名称,第三个是子路径,第四个是父对象。在代码中,DConfig::createGeneric函数只传递了两个参数,这可能会导致配置无法正确创建。

  5. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  6. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  7. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  8. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  9. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  10. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  11. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  12. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  13. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  14. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  15. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  16. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  17. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  18. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  19. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  20. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  21. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  22. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  23. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  24. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  25. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  26. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  27. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  28. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  29. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  30. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  31. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  32. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  33. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  34. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  35. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  36. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  37. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  38. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  39. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  40. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  41. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  42. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  43. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  44. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是DConfig指针,而不是QObject指针。在代码中,initializeInConfigThread函数的第一个参数是QObject指针,这可能会导致初始化失败。

  45. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,QMetaObject::invokeMethod函数的使用方式有误。QMetaObject::invokeMethod函数的第一个参数应该是QObject指针,而不是QThread指针。在代码中,QMetaObject::invokeMethod函数的第一个参数是QThread指针,这可能会导致调用失败。

  46. orgdeepindtkpreference.hpp文件中,OrgDeepinDTKPreference类的构造函数中,initializeInConfigThread函数的使用方式有误。initializeInConfigThread函数的第一个参数应该是`D

@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor
  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "src/kernel/dguiapplicationhelper.cpp": [
        {
            "line": "    QString socket_key = \"_d_dtk_single_instance_\";",
            "line_number": 1468,
            "rule": "S106",
            "reason": "Var naming | 2ad926d35b"
        }
    ]
}

@deepin-bot

deepin-bot Bot commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 5.7.13
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #310

@deepin-bot

deepin-bot Bot commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 5.7.14
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #312

zccrs added 2 commits April 21, 2025 11:28
Maybe start from 6.8.1
The org.deepin.dtk.preference.json file is not in this project, so
we can't generated codes by cmake.
deepin-ci-robot added a commit to linuxdeepin/dtk6gui that referenced this pull request Apr 21, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#309
@zccrs
zccrs requested a review from Copilot April 21, 2025 03:29
@github-actions

Copy link
Copy Markdown
Contributor
  • 敏感词检查失败, 检测到1个文件存在敏感词
详情
{
    "src/kernel/dguiapplicationhelper.cpp": [
        {
            "line": "    QString socket_key = \"_d_dtk_single_instance_\";",
            "line_number": 1468,
            "rule": "S106",
            "reason": "Var naming | 2ad926d35b"
        }
    ]
}

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adapts the configuration system to use asynchronous read/write via the new OrgDeepinDTKPreference API, replacing the old DConfig-based approach.

  • Updated pixmap access in XdgIconProxyEngine using QT version conditionals
  • Replaced DConfig usages with OrgDeepinDTKPreference in theme-related files
  • Updated signal connections in the application helper to use the new API

Reviewed Changes

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

File Description
src/util/private/xdgiconproxyengine.cpp Introduces conditional compilation to use an updated pixmap API
src/private/dplatformtheme_p.h Replaces DConfig with a forward-declared OrgDeepinDTKPreference pointer
src/kernel/dplatformtheme.cpp Updates theme configuration to rely on new OrgDeepinDTKPreference APIs
src/kernel/dguiapplicationhelper.cpp Uses new global static OrgDeepinDTKPreference and signal changes
Files not reviewed (2)
  • .reuse/dep5: Language not supported
  • src/kernel/kernel.cmake: Language not supported
Comments suppressed due to low confidence (3)

src/util/private/xdgiconproxyengine.cpp:193

  • [nitpick] The hardcoded scaling factor (1.0) could be defined as a named constant to improve clarity and facilitate future adjustments.
return entry->pixmap(size, mode, state, 1.0);

src/kernel/dguiapplicationhelper.cpp:459

  • [nitpick] Consider using _d_dconfig() instead of _d_dconfig.operator ()() for clarity when accessing the global static instance.
QObject::connect(_d_dconfig.operator ()(), &OrgDeepinDTKPreference::themeTypeChanged, _d_dconfig, [applyThemeType] {

src/kernel/dplatformtheme.cpp:114

  • Verify that the return value from dtkPreferenceConfig->sizeMode() is guaranteed to be within the valid range for DGuiApplicationHelper::SizeMode to avoid potential mismatches.
d->sizeMode = static_cast<DGuiApplicationHelper::SizeMode>(d->dtkPreferenceConfig->sizeMode());

@deepin-ci-robot

Copy link
Copy Markdown
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.

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

@18202781743

Copy link
Copy Markdown
Contributor

@18202781743 这个提交的功能需要你验证下

测试过调色板,滚动条,紧凑模式,没问题,

@zccrs

zccrs commented Apr 25, 2025

Copy link
Copy Markdown
Member Author

@18202781743 这个提交的功能需要你验证下

测试过调色板,滚动条,紧凑模式,没问题,

OK,那就合入了

@zccrs
zccrs merged commit 7c2b35a into linuxdeepin:master Apr 25, 2025
18202781743 pushed a commit to linuxdeepin/dtk6gui that referenced this pull request Apr 25, 2025
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#309
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