Skip to content

Commit

Permalink
Common: merge to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andyholmes committed Dec 22, 2017
1 parent 7848067 commit ba1ffbb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ var Device = new Lang.Class({
this.daemon = daemon;

this.settings = new Gio.Settings({
settings_schema: Common.SchemaSource.lookup(
settings_schema: ext.gschema.lookup(
"org.gnome.Shell.Extensions.GSConnect.Device",
true
),
Expand Down
16 changes: 8 additions & 8 deletions src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ for (let path of [ext.cachedir, ext.configdir, ext.runtimedir]) {
/**
* Init GSettings
*/
var SchemaSource = Gio.SettingsSchemaSource.new_from_directory(
ext.gschema = Gio.SettingsSchemaSource.new_from_directory(
GLib.build_filenamev([ext.datadir, "schemas"]),
Gio.SettingsSchemaSource.get_default(),
false
);

settings_schema: SchemaSource.lookup(ext.app_id, true)
ext.settings = new Gio.Settings({
settings_schema: ext.gschema.lookup(ext.app_id, true)
});


/**
* Register resources
*/
var Resource = Gio.Resource.load(
ext.resource = Gio.Resource.load(
GLib.build_filenamev([ext.datadir, ext.app_id + ".data.gresource"])
);
Resource._register();
ext.resource._register();


/**
Expand Down Expand Up @@ -77,10 +77,10 @@ window.debug = function (msg) {
* Check if a command is in the PATH
* @param {string} name - the name of the command
*/
function checkCommand (name) {
function checkCommand (cmd) {
let proc = GLib.spawn_async_with_pipes(
null, // working dir
["which", name], // argv
["which", cmd], // argv
null, // envp
GLib.SpawnFlags.SEARCH_PATH, // enables PATH
null // child_setup (func)
Expand All @@ -103,8 +103,8 @@ function checkCommand (name) {
*/
function getCertificate (id) {
let settings = new Gio.Settings({
settings_schema: SchemaSource.lookup(ext.app_id + ".Device", true),
path: "/org/gnome/shell/extensions/gsconnect/device/" + id + "/"
settings_schema: ext.gschema.lookup(ext.app_id + ".Device", true),
path: ext.settings.path + "device/" + id + "/"
});

if (settings.get_string("certificate-pem")) {
Expand Down
2 changes: 1 addition & 1 deletion src/service/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var Device = new Lang.Class({

// GSettings
this.settings = new Gio.Settings({
settings_schema: Common.SchemaSource.lookup(
settings_schema: ext.gschema.lookup(
"org.gnome.Shell.Extensions.GSConnect.Device",
true
),
Expand Down
4 changes: 2 additions & 2 deletions src/service/plugins/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var Plugin = new Lang.Class({
// Init GSettings
if (imports.service.plugins[name].SettingsDialog) {
this.settings = new Gio.Settings({
settings_schema: Common.SchemaSource.lookup(metadata.uuid, -1),
settings_schema: ext.gschema.lookup(metadata.uuid, -1),
path: ext.settings.path + "device/" + device.id + "/plugin/" + name + "/"
});
}
Expand Down Expand Up @@ -75,7 +75,7 @@ var SettingsDialog = new Lang.Class({
let metadata = imports.service.plugins[name].METADATA;

this.settings = new Gio.Settings({
settings_schema: Common.SchemaSource.lookup(metadata.uuid, -1),
settings_schema: ext.gschema.lookup(metadata.uuid, -1),
path: ext.settings.path + "device/" + device.id + "/plugin/" + name + "/"
});
this.settings.delay();
Expand Down

0 comments on commit ba1ffbb

Please sign in to comment.