代码拉取完成,页面将自动刷新
From 24a3b5e00c9d57472e5b06d59248df9fcecedc87 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 8 Oct 2024 10:36:03 +0800
Subject: [PATCH] fix(gnome): Fix crash caused by the previous commit due to
the existence of a schema but the absence of a color-schema
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复上次提交导致存在schema但是不存在color-scehma导致崩溃,加强对于schema以及key的判断
---
plugins/appearance/theme/appearance-theme.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/plugins/appearance/theme/appearance-theme.cpp b/plugins/appearance/theme/appearance-theme.cpp
index 186e156..9f31ca5 100644
--- a/plugins/appearance/theme/appearance-theme.cpp
+++ b/plugins/appearance/theme/appearance-theme.cpp
@@ -53,7 +53,13 @@ AppearanceTheme::AppearanceTheme()
if (std::find(schemas.begin(), schemas.end(), GNOME_DESKTOP_SCHEMA_ID) != schemas.end())
{
- this->gnome_desktop_settigns_ = Gio::Settings::create(GNOME_DESKTOP_SCHEMA_ID);
+ auto temp_settings = Gio::Settings::create(GNOME_DESKTOP_SCHEMA_ID);
+ auto keys = temp_settings->list_keys();
+ if ( std::find(keys.begin(), keys.end(), GNOME_DESKTOP_SCHEMA_KEY_COLOR_SCHEMA) != keys.end() )
+ {
+ // 确保 org.gnome.desktop.interface color-scheme 完全存在才使用
+ this->gnome_desktop_settigns_ = temp_settings;
+ }
}
}
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。