1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-18 13:55:45 +01:00

Fix bugs and stuff.

This commit is contained in:
Kris Maglione
2013-01-05 13:53:07 -08:00
parent 0985f8346d
commit b02c4b39e6
9 changed files with 119 additions and 58 deletions

View File

@@ -176,6 +176,8 @@ var ObjectStore = Class("ObjectStore", StoreBase, {
}
});
var sessionGlobal = Cu.import("resource://gre/modules/Services.jsm", {})
var Storage = Module("Storage", {
alwaysReload: {},
@@ -184,7 +186,7 @@ var Storage = Module("Storage", {
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
if (!Services.dactylSession)
Services.dactylSession = {};
Services.dactylSession = Cu.createObjectIn(sessionGlobal);
this.session = Services.dactylSession;
},
@@ -201,6 +203,13 @@ var Storage = Module("Storage", {
this.observers = {};
},
storeForSession: function storeForSession(key, val) {
if (val)
this.session[key] = sessionGlobal.JSON.parse(JSON.stringify(val));
else
delete this.dactylSession[key];
},
infoPath: Class.Memoize(function ()
File(IO.runtimePath.replace(/,.*/, ""))
.child("info").child(config.profileName)),