[gnome-tweak-tool/gnome-3-16] Avoid GSettings aborting when missing classic overrides schema



commit 46d8f75708912a1e4953898775c1bf60d72fab0a
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Aug 26 17:56:47 2015 +0200

    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 files 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
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]