summaryrefslogtreecommitdiffstats
path: root/extensions/hibernate-status/prefs.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-18 13:38:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-18 13:38:38 +0000
commita2afeba6545be9307f6505fd7a29375e89a9075e (patch)
treec598c70f26a350073352322c6d2d4da6952945fa /extensions/hibernate-status/prefs.js
parentReleasing debian version 20230205-2. (diff)
downloadgnome-shell-extensions-extra-a2afeba6545be9307f6505fd7a29375e89a9075e.tar.xz
gnome-shell-extensions-extra-a2afeba6545be9307f6505fd7a29375e89a9075e.zip
Merging upstream version 20230618.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extensions/hibernate-status/prefs.js')
-rw-r--r--extensions/hibernate-status/prefs.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/extensions/hibernate-status/prefs.js b/extensions/hibernate-status/prefs.js
index cdcd50e..83b5843 100644
--- a/extensions/hibernate-status/prefs.js
+++ b/extensions/hibernate-status/prefs.js
@@ -17,15 +17,25 @@ var Prefs = class Prefs {
this.KEY_HIBERNATE_WORKS_CHECK = "hibernate-works-check";
this._schemaName = "org.gnome.shell.extensions.hibernate-status-button";
- let schemaDir = Me.dir.get_child('schemas').get_path();
+ // first try developer local schema
+ try {
+ let schemaDir = Me.dir.get_child('schemas').get_path();
- let schemaSource = Gio.SettingsSchemaSource.new_from_directory(
- schemaDir, Gio.SettingsSchemaSource.get_default(), false
- );
- let schema = schemaSource.lookup(this._schemaName, false);
+ let schemaSource = Gio.SettingsSchemaSource.new_from_directory(
+ schemaDir, Gio.SettingsSchemaSource.get_default(), false
+ );
+ let schema = schemaSource.lookup(this._schemaName, false);
+
+ this._setting = new Gio.Settings({
+ settings_schema: schema
+ });
+ return;
+ } catch (e) {
+ // now try system-wide one below
+ }
this._setting = new Gio.Settings({
- settings_schema: schema
+ schema_id: this._schemaName
});
}
/**