1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 05:27:58 +01:00

Refactor storage init. Fixes issue #143.

This commit is contained in:
Kris Maglione
2009-11-09 06:16:28 -05:00
parent a72068c9f7
commit 092fb1ea15

View File

@@ -17,9 +17,21 @@ const EVAL_STRING = "__liberator_eval_string";
// Move elsewhere? // Move elsewhere?
const Storage = Module("storage", { const Storage = Module("storage", {
requires: ["services"],
init: function () { init: function () {
Components.utils.import("resource://liberator/storage.jsm", this); Components.utils.import("resource://liberator/storage.jsm", this);
modules.Timer = this.Timer; // Fix me, please. modules.Timer = this.Timer; // Fix me, please.
try {
let infoPath = services.create("file");
infoPath.initWithPath(File.expandPath(IO.runtimePath.replace(/,.*/, "")));
infoPath.append("info");
infoPath.append(liberator.profileName);
this.storage.infoPath = infoPath;
}
catch (e) {}
return this.storage; return this.storage;
}, },
}); });
@@ -1718,19 +1730,6 @@ const Liberator = Module("liberator", {
load: function () { load: function () {
config.features.push(Liberator.getPlatformFeature()); config.features.push(Liberator.getPlatformFeature());
try {
let infoPath = services.create("file");
infoPath.initWithPath(File.expandPath(IO.runtimePath.replace(/,.*/, "")));
infoPath.append("info");
infoPath.append(liberator.profileName);
storage.infoPath = infoPath;
}
catch (e) {
liberator.reportError(e);
}
config.init();
liberator.triggerObserver("load"); liberator.triggerObserver("load");
liberator.log("All modules loaded", 3); liberator.log("All modules loaded", 3);