From 4ed9d96276ea0510177d16d449dfb0d9ffb0cc2d Mon Sep 17 00:00:00 2001
From: meizhigang <meizhigang@kylinsec.com.cn>
Date: Fri, 13 Jan 2023 09:38:23 +0800
Subject: [PATCH] fix(appearance):Fix plugin appearance load when caja does not
 exist
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

 -当caja不存在时适配appearance插件加载

 #62952
---
 plugins/appearance/font/appearance-font.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugins/appearance/font/appearance-font.cpp b/plugins/appearance/font/appearance-font.cpp
index 6e98a02..64bf8d8 100644
--- a/plugins/appearance/font/appearance-font.cpp
+++ b/plugins/appearance/font/appearance-font.cpp
@@ -33,7 +33,12 @@ AppearanceFont::AppearanceFont()
     this->xsettings_settings_ = Gio::Settings::create(XSETTINGS_SCHEMA_ID);
     this->interface_settings_ = Gio::Settings::create(INTERFACE_SCHEMA_ID);
     this->marco_settings_ = Gio::Settings::create(MARCO_SCHEMA_ID);
-    this->caja_settings_ = Gio::Settings::create(CAJA_SCHEMA_ID);
+
+    auto schemas = Gio::Settings::list_schemas();
+    if (std::find(schemas.begin(), schemas.end(), CAJA_SCHEMA_ID) != schemas.end())
+    {
+        this->caja_settings_ = Gio::Settings::create(CAJA_SCHEMA_ID);
+    }
 }
 
 void AppearanceFont::init()
-- 
2.27.0

