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:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-18 13:38:09 +0000
commit7f9c96a5a1e619c03bf81c8b3783703b780edaf4 (patch)
treeba7cd337e9890761eb7b30f97e19a37db15de4c4 /extensions/hibernate-status/prefs.js
parentAdding upstream version 20230205. (diff)
downloadgnome-shell-extensions-extra-7f9c96a5a1e619c03bf81c8b3783703b780edaf4.tar.xz
gnome-shell-extensions-extra-7f9c96a5a1e619c03bf81c8b3783703b780edaf4.zip
Adding upstream version 20230618.upstream/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
});
}
/**