[gnome-tweak-tool] Avoid GSettings aborting when missing classic overrides schema
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Avoid GSettings aborting when missing classic overrides schema
- Date: Fri, 28 Aug 2015 12:26:32 +0000 (UTC)
commit de3ff6c635e5f1058dc2e56300865035b9e3ff3e
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]