fix: 修复应用级别配置部分不生效的问题

当此配置要求应用隐藏(com.deepin.dde.dock.module.app enable=false)时,及时activeapp的配置的enable为true,应用仍然隐藏
托盘应用区域com.deepin.dde.dock.module.systemtray control不生效的问题也一起修复

Log:
Task: https://pms.uniontech.com/zentao/task-view-64795.html
Change-Id: I49d6a26425509948038ef80d8b31d23483460299
This commit is contained in:
Fan PengCheng 2021-05-07 19:47:43 +08:00 committed by fanpengcheng
parent 2972f837fc
commit 703da727b1
2 changed files with 5 additions and 3 deletions

View File

@ -732,8 +732,8 @@ bool AppItem::checkGSettingsControl() const
? m_dockedAppSettings ? m_dockedAppSettings
: m_activeAppSettings; : m_activeAppSettings;
return (setting && setting->keys().contains("control") && setting->get("control").toBool()) || return ((m_appSettings && m_appSettings->keys().contains("control") && m_appSettings->get("control").toBool())
(m_appSettings && m_appSettings->keys().contains("control") && m_appSettings->get("control").toBool()); || (setting && setting->keys().contains("control") && setting->get("control").toBool()));
} }
void AppItem::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) void AppItem::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType)

View File

@ -491,5 +491,7 @@ void SystemTrayItem::onGSettingsChanged(const QString &key) {
bool SystemTrayItem::checkGSettingsControl() const bool SystemTrayItem::checkGSettingsControl() const
{ {
return (m_gsettings && m_gsettings->get("control").toBool()); // 优先判断com.deepin.dde.dock.module.systemtray的control值是否为true优先级更高如果不为true再判断每一个托盘对应的gsetting配置的control值
bool isEnable = Utils::SettingValue("com.deepin.dde.dock.module.systemtray", QByteArray(), "control", false).toBool();
return (isEnable || (m_gsettings && m_gsettings->get("control").toBool()));
} }