fix: fix control center plugin loading and page display logic#3142
fix: fix control center plugin loading and page display logic#3142caixr23 wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
1. Changed PluginManager::addObject signal connection from Qt::QueuedConnection to direct connection to ensure immediate object addition 2. Modified tryShow() condition to check m_showTimer instead of m_activeObject for determining when to clear show parameters 3. Added fallback to show root page when no active object exists after clearing show parameters 4. Reordered emit sequence in addMainObject() to ensure addObject signals are emitted before the final updatePluginStatus signal Log: Fixed control center page display issues when loading plugins Influence: 1. Test control center startup with various plugin configurations 2. Verify page navigation works correctly after plugin loading 3. Test D-Bus show requests with different URL parameters 4. Ensure plugin objects are properly added and displayed 5. Verify root page displays correctly when no specific page is requested fix: 修复控制中心插件加载和页面显示逻辑 1. 将 PluginManager::addObject 信号连接从 Qt::QueuedConnection 改为直接 连接,确保对象立即添加 2. 修改 tryShow() 条件,使用 m_showTimer 代替 m_activeObject 来判断何时 清除显示参数 3. 添加在清除显示参数后没有活动对象时回退显示根页面的逻辑 4. 重新排序 addMainObject() 中的信号发射顺序,确保 addObject 信号在最终 的 updatePluginStatus 信号之前发射 Log: 修复控制中心在加载插件时的页面显示问题 Influence: 1. 测试控制中心在不同插件配置下的启动情况 2. 验证插件加载后的页面导航功能是否正常 3. 测试使用不同URL参数的D-Bus显示请求 4. 确保插件对象被正确添加和显示 5. 验证当没有特定页面请求时根页面是否正确显示
|
[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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts control center plugin loading and page display timing by making plugin object additions immediate, refining when show parameters are cleared, adding a root-page fallback when no active object is available, and reordering plugin status signals to better reflect object availability. Sequence diagram for updated plugin loading and page displaysequenceDiagram
actor User
participant ControlCenterUI as DccManager
participant PluginMgr as PluginManager
participant ShowTimer as QTimer_showTimer
participant DBusClient
User ->> ControlCenterUI: startControlCenter()
ControlCenterUI ->> PluginMgr: loadAllPlugins()
PluginMgr ->> PluginMgr: addMainObject(plugin)
PluginMgr -->> ControlCenterUI: addObject(mainObj)
ControlCenterUI ->> ControlCenterUI: addObject(mainObj) sets m_activeObject
PluginMgr -->> ControlCenterUI: addObject(soObj)
ControlCenterUI ->> ControlCenterUI: addObject(soObj) maybe updates m_activeObject
PluginMgr -->> ControlCenterUI: updatePluginStatus(plugin, MainObjEnd|PluginEnd, "add main object finished")
PluginMgr -->> ControlCenterUI: loadAllFinished
ControlCenterUI -->> ControlCenterUI: tryShow() (queued)
DBusClient ->> ControlCenterUI: show(url)
ControlCenterUI ->> ControlCenterUI: set m_showUrl, start m_showTimer
ShowTimer ->> ControlCenterUI: timeout -> tryShow()
alt m_showUrl is empty and m_showTimer exists
ControlCenterUI ->> ControlCenterUI: clearShowParam()
ControlCenterUI ->> ControlCenterUI: showPage(m_root, "")
else m_showUrl is not empty
ControlCenterUI ->> ControlCenterUI: find object for m_showUrl
alt object found
ControlCenterUI ->> ControlCenterUI: showPage(targetObj, subPage)
ControlCenterUI ->> ControlCenterUI: clearShowParam()
alt no m_activeObject after clear
ControlCenterUI ->> ControlCenterUI: showPage(m_root, "")
end
else object not found
ControlCenterUI ->> DBusClient: errorReply(InvalidArgs, not_found_url)
ControlCenterUI ->> ControlCenterUI: clearShowParam()
alt no m_activeObject after clear
ControlCenterUI ->> ControlCenterUI: showPage(m_root, "")
end
end
end
Updated class diagram for DccManager and PluginManagerclassDiagram
class DccManager {
- PluginManager* m_plugins
- QTimer* m_showTimer
- QString m_showUrl
- QObject* m_activeObject
- QObject* m_root
- QList~QObject*~ m_noParentObjects
+ DccManager(QObject* parent)
+ void addObject(QObject* obj)
+ void clearShowParam()
+ void tryShow()
+ void showPage(QObject* root, QString subPageId)
}
class PluginManager {
+ void addMainObject(PluginData* plugin)
+ void moduleLoading()
<<signal>> void addObject(QObject* obj)
<<signal>> void loadAllFinished()
<<signal>> void updatePluginStatus(PluginData* plugin, int status, QString message)
}
class PluginData {
+ QObject* mainObj
+ QObject* soObj
}
DccManager --> PluginManager : uses
PluginManager --> PluginData : manages
PluginManager ..> DccManager : addObject signal
PluginManager ..> DccManager : loadAllFinished signal
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
DccManager::tryShow(), the new conditionm_showUrl.isEmpty() && m_showTimerwill always be true after construction becausem_showTimeris never null; if the intent was to guard on a pending timer-based show, consider checkingm_showTimer->isActive()(or an equivalent state) instead of the pointer itself. - Changing the
PluginManager::addObjectconnection fromQt::QueuedConnectionto the default direct/auto connection can introduce cross-thread issues ifPluginManagerever lives in a different thread fromDccManager; consider either documenting the same-thread assumption or usingQt::AutoConnectionwith an explicit guarantee on thread affinity.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `DccManager::tryShow()`, the new condition `m_showUrl.isEmpty() && m_showTimer` will always be true after construction because `m_showTimer` is never null; if the intent was to guard on a pending timer-based show, consider checking `m_showTimer->isActive()` (or an equivalent state) instead of the pointer itself.
- Changing the `PluginManager::addObject` connection from `Qt::QueuedConnection` to the default direct/auto connection can introduce cross-thread issues if `PluginManager` ever lives in a different thread from `DccManager`; consider either documenting the same-thread assumption or using `Qt::AutoConnection` with an explicit guarantee on thread affinity.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 6.1.80 |
Log: Fixed control center page display issues when loading plugins
Influence:
fix: 修复控制中心插件加载和页面显示逻辑
Log: 修复控制中心在加载插件时的页面显示问题
Influence:
Summary by Sourcery
Fix control center page display behavior around plugin loading and show routing.
Bug Fixes: