Blob Blame History Raw
From 057865f94b1ba9e16b197eeee69e538f953594e7 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Wed, 26 Aug 2015 17:56:47 +0200
Subject: [PATCH] Avoid GSettings aborting when missing classic overrides
 schema

We must go through our GSettingsSetting class instead of directly
creating a GSettings instance otherwise if the classic overrides
schema isn't installed, GSettings will abort us.

https://bugzilla.gnome.org/show_bug.cgi?id=754132
---
 gtweak/widgets.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gtweak/widgets.py b/gtweak/widgets.py
index e804f0f..4633c80 100644
--- a/gtweak/widgets.py
+++ b/gtweak/widgets.py
@@ -140,9 +140,13 @@ def adjust_schema_for_overrides(originalSchema, key, options):
         overridesSchema = "org.gnome.shell.overrides"
         overridesFile = "org.gnome.shell.gschema.xml"
 
-    if (key in Gio.Settings(schema=overridesSchema).list_keys()):
-        options['schema_filename'] = overridesFile
-        return overridesSchema
+    try:
+        if (key in GSettingsSetting(overridesSchema, schema_filename=overridesFile).list_keys()):
+            options['schema_filename'] = overridesFile
+            return overridesSchema
+    except GSettingsMissingError, e:
+        logging.info("GSetting missing %s" % (e.message))
+
     return originalSchema
 
 
-- 
2.4.3