Skip to content

refactor: optimize plugin loading and QML registration#3143

Open
caixr23 wants to merge 2 commits intolinuxdeepin:dcc-coredumpfrom
caixr23:master
Open

refactor: optimize plugin loading and QML registration#3143
caixr23 wants to merge 2 commits intolinuxdeepin:dcc-coredumpfrom
caixr23:master

Conversation

@caixr23
Copy link
Copy Markdown
Contributor

@caixr23 caixr23 commented Apr 2, 2026

This refactor improves plugin management by separating QML registration from plugin object creation. Key changes include:

  1. Added QML_ENGINE_PROPERTY constant for QML engine property name
  2. Modified DCC_FACTORY_CLASS macro to accept variadic arguments for QML registration
  3. Added dccObject() method in factory to handle QML type registration on main thread
  4. Created containsByName() method for more efficient module filtering
  5. Improved plugin loading sequence with proper thread management
  6. Moved all QML registration calls from constructors to factory's dccObject() method
  7. Removed unnecessary QML integration headers from model classes

The changes ensure QML type registration happens on the main thread while plugin objects are created in worker threads, preventing threading issues and improving performance.

Log: Optimized plugin loading process and QML registration

Influence:

  1. Test plugin loading and module display in control center
  2. Verify all QML components are properly registered and accessible
  3. Check module hiding functionality with wildcard patterns
  4. Test thread safety during plugin initialization
  5. Verify no regression in existing functionality

refactor: 优化插件加载和 QML 注册流程

本次重构改进了插件管理机制,将 QML 注册与插件对象创建分离。主要变更
包括:

  1. 添加 QML_ENGINE_PROPERTY 常量用于 QML 引擎属性名
  2. 修改 DCC_FACTORY_CLASS 宏支持可变参数用于 QML 注册
  3. 在工厂类中添加 dccObject() 方法处理主线程中的 QML 类型注册
  4. 创建 containsByName() 方法实现更高效的模块过滤
  5. 改进插件加载序列,优化线程管理
  6. 将所有 QML 注册调用从构造函数移至工厂的 dccObject() 方法
  7. 从模型类中移除不必要的 QML 集成头文件

这些变更确保 QML 类型注册在主线程执行,而插件对象在工作线程创建,避免线
程问题并提升性能。

Log: 优化插件加载过程和 QML 注册机制

Influence:

  1. 测试控制中心插件加载和模块显示
  2. 验证所有 QML 组件正确注册并可访问
  3. 检查通配符模式下的模块隐藏功能
  4. 测试插件初始化期间的线程安全性
  5. 验证现有功能无回归

PMS: BUG-309197

This refactor improves plugin management by separating QML registration
from plugin object creation. Key changes include:
1. Added QML_ENGINE_PROPERTY constant for QML engine property name
2. Modified DCC_FACTORY_CLASS macro to accept variadic arguments for
QML registration
3. Added dccObject() method in factory to handle QML type registration
on main thread
4. Created containsByName() method for more efficient module filtering
5. Improved plugin loading sequence with proper thread management
6. Moved all QML registration calls from constructors to factory's
dccObject() method
7. Removed unnecessary QML integration headers from model classes

The changes ensure QML type registration happens on the main thread
while plugin objects are created in worker threads, preventing threading
issues and improving performance.

Log: Optimized plugin loading process and QML registration

Influence:
1. Test plugin loading and module display in control center
2. Verify all QML components are properly registered and accessible
3. Check module hiding functionality with wildcard patterns
4. Test thread safety during plugin initialization
5. Verify no regression in existing functionality

refactor: 优化插件加载和 QML 注册流程

本次重构改进了插件管理机制,将 QML 注册与插件对象创建分离。主要变更
包括:
1. 添加 QML_ENGINE_PROPERTY 常量用于 QML 引擎属性名
2. 修改 DCC_FACTORY_CLASS 宏支持可变参数用于 QML 注册
3. 在工厂类中添加 dccObject() 方法处理主线程中的 QML 类型注册
4. 创建 containsByName() 方法实现更高效的模块过滤
5. 改进插件加载序列,优化线程管理
6. 将所有 QML 注册调用从构造函数移至工厂的 dccObject() 方法
7. 从模型类中移除不必要的 QML 集成头文件

这些变更确保 QML 类型注册在主线程执行,而插件对象在工作线程创建,避免线
程问题并提升性能。

Log: 优化插件加载过程和 QML 注册机制

Influence:
1. 测试控制中心插件加载和模块显示
2. 验证所有 QML 组件正确注册并可访问
3. 检查通配符模式下的模块隐藏功能
4. 测试插件初始化期间的线程安全性
5. 验证现有功能无回归

PMS: BUG-309197
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @caixr23, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23

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

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