feat(factory): upgrade DccFactory to v2.0 with lifecycle and DBus data channel#3228
feat(factory): upgrade DccFactory to v2.0 with lifecycle and DBus data channel#3228caixr23 wants to merge 1 commit into
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| class DccObject; | ||
|
|
||
| class DccFactory : public QObject | ||
| class DccFactory_20 : public QObject |
There was a problem hiding this comment.
保留DccFactory名,旧插件处理会不会冲突
| }; \ | ||
| } | ||
|
|
||
| #define DCC_FULL_FACTORY_CLASS(classname) \ |
There was a problem hiding this comment.
命名带版本号可以不冲突 DCC_FACTORY_V20_CLASS
| Q_SIGNALS: | ||
| // 模块中有设置项变化时,发出该信号 | ||
| // 命名valuesChanged() 待定 | ||
| void propertiesChanged(const QVariantMap &properties); |
There was a problem hiding this comment.
信号命名问题,数据类型用QString(json)还是QVariantMap,get/set的类型要不要统一?
信号是否有依赖插件是否实现
|
TAG Bot New tag: 6.1.86 |
|
TAG Bot New tag: 6.1.87 |
|
TAG Bot New tag: 6.1.88 |
|
TAG Bot New tag: 6.1.89 |
|
TAG Bot New tag: 6.1.90 |
|
TAG Bot New tag: 6.1.91 |
…a channel 1. Rename DccFactory to DccFactory_20, bump IID to v2.0 2. Add registerType() for QML type registration in main thread 3. Add active() for post-creation activation in main thread 4. Add get/set virtual methods for DBus-triggered data access in worker thread 5. Add DCC_FULL_FACTORY_CLASS macro with singleton create and full lifecycle delegation to classname::registerType/active/get/set 6. Preserve v1.0 interface in dccfactoryold.h for backward compatibility 7. Wire DBus get/set slots in ControlCenterDBusAdaptor and DccManager (async dispatch pending) 8. Migrate DefAppModel plugin as first v2.0 adopter, move qmlRegisterType into static registerType() Influence: 1. Verify existing v1.0 plugins still load via old interface 2. Verify DefAppModel QML types register correctly on startup feat(factory): 升级 DccFactory 至 v2.0,支持生命周期管理与 DBus 数据通道 1. 将 DccFactory 重命名为 DccFactory_20,IID 升级为 v2.0 2. 新增 registerType() 用于在主线程中注册 QML 类型 3. 新增 active() 用于在主线程中执行创建后激活 4. 新增 get/set 虚函数用于在子线程中响应 DBus 数据请求 5. 新增 DCC_FULL_FACTORY_CLASS 宏,支持单例创建及完整生命周期 委托至 classname::registerType/active/get/set 6. 在 dccfactoryold.h 中保留 v1.0 接口以向后兼容 7. 在 ControlCenterDBusAdaptor 和 DccManager 中接入 DBus get/set (异步分发待实现) 8. 迁移 DefAppModel 插件作为首个 v2.0 适配示例,将 qmlRegisterType 移入静态 registerType() Influence: 1. 验证已有的 v1.0 插件仍能通过旧接口正常加载 2. 验证 DefAppModel 的 QML 类型在启动时正确注册
deepin pr auto review代码审查意见总体评价这个diff展示了对DCC (Deepin Control Center)框架的重大重构,主要是从v1.0升级到v2.0版本。主要变化包括引入了新的工厂模式、DBus通信机制、以及插件加载策略的优化。整体架构设计合理,但存在一些需要注意的问题。 具体问题及建议1. 代码质量问题DccFactory接口变更
DBus接口实现
2. 代码性能问题插件加载策略
线程安全
3. 代码安全问题DBus通信安全
内存管理
4. 架构设计建议插件加载模式
错误处理
5. 其他建议
总结这个重构版本引入了许多改进,特别是在架构设计和功能扩展方面。然而,需要注意兼容性、性能和安全性问题。建议在后续版本中:
|
|
TAG Bot New tag: 6.1.92 |
|
TAG Bot New tag: 6.1.93 |
|
TAG Bot New tag: 6.1.94 |
|
TAG Bot New tag: 6.1.95 |
|
TAG Bot New tag: 6.1.96 |
|
TAG Bot New tag: 6.1.97 |
|
TAG Bot New tag: 6.1.98 |
|
TAG Bot New tag: 6.1.99 |
Influence:
feat(factory): 升级 DccFactory 至 v2.0,支持生命周期管理与 DBus 数据通道
Influence: