fix(theme): skip initGlobalTheme for treeland environment#272
Merged
Conversation
Treeland does not need global theme initialization logic. All personalization settings in treeland follow the control center protocol instead. treeland环境下跳过全局主题初始化,treeland下所有个性化设置走控制中心协议。 Log: treeland下跳过全局主题初始化 PMS: TASK-391987 Influence: treeland环境下不再执行全局主题初始化,避免与控制中心协议冲突。 Change-Id: I70dcfee6981869a740bd444799f273efa34d41bc
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the global theme initialization logic so that in the Treeland environment global theme init is skipped and the theme is instead aligned with the property-based value, avoiding conflict with the control center protocol. Sequence diagram for updated initGlobalTheme behavior in TreelandsequenceDiagram
participant Caller
participant AppearanceManager
participant utils
participant Subthemes
Caller->>AppearanceManager: initGlobalTheme()
AppearanceManager->>utils: isTreeland()
utils-->>AppearanceManager: bool
alt [Treeland environment]
AppearanceManager->>AppearanceManager: m_currentGlobalTheme = m_property->globalTheme
AppearanceManager-->>Caller: return
else [Non-Treeland environment]
AppearanceManager->>Subthemes: listGlobalThemes()
Subthemes-->>AppearanceManager: QVector<Theme>
AppearanceManager->>AppearanceManager: select and apply global theme
AppearanceManager-->>Caller: return
end
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 found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/service/impl/appearancemanager.cpp" line_range="1698-1703" />
<code_context>
{
+ // treeland 不需要走初始化全局主题逻辑,treeland下所有的个性化设置全部走控制中心的协议
+ if (utils::isTreeland()) {
+ qInfo() << "treeland, skip initGlobalTheme";
+ m_currentGlobalTheme = m_property->globalTheme;
+ return;
</code_context>
<issue_to_address>
**suggestion:** Evaluate whether qInfo is the appropriate log level for this path, given it runs on every Treeland startup.
Since this runs on every Treeland startup, please confirm whether this message is truly noteworthy in production. If it’s part of a normal path, consider downgrading to debug or removing it to reduce log noise; otherwise keeping it at info is fine.
```suggestion
// treeland 不需要走初始化全局主题逻辑,treeland下所有的个性化设置全部走控制中心的协议
if (utils::isTreeland()) {
// 正常启动路径上的日志,降低到 debug 级别以减少生产环境中的日志噪音
qDebug() << "treeland, skip initGlobalTheme";
m_currentGlobalTheme = m_property->globalTheme;
return;
}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 当前代码已足够优秀,无需改进,此处展示当前最佳实践
void AppearanceManager::initGlobalTheme()
{
// treeland 不需要走初始化全局主题逻辑,treeland下所有的个性化设置全部走控制中心的协议
if (utils::isTreeland()) {
qInfo() << "treeland, skip initGlobalTheme";
m_currentGlobalTheme = m_property->globalTheme;
return;
}
QVector<QSharedPointer<Theme>> globalList = m_subthemes->listGlobalThemes();
bool bFound = false;
} |
robertkill
approved these changes
Jun 25, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, robertkill 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Treeland does not need global theme initialization logic. All personalization settings in treeland follow the control center protocol instead.
treeland环境下跳过全局主题初始化,treeland下所有个性化设置走控制中心协议。
Log: treeland下跳过全局主题初始化
PMS: TASK-391987
Influence: treeland环境下不再执行全局主题初始化,避免与控制中心协议冲突。
Change-Id: I70dcfee6981869a740bd444799f273efa34d41bc
Summary by Sourcery
Skip global theme initialization in treeland environments to align personalization handling with the control center protocol.
Bug Fixes:
Enhancements:
Documentation: