1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-30 10:13:32 +02:00

Rip out FUEL references. Use a persistent component instead.

This commit is contained in:
Kris Maglione
2011-02-19 18:23:32 -05:00
parent 1dcbf88509
commit 0de541726b
6 changed files with 30 additions and 16 deletions

View File

@@ -8,11 +8,10 @@ try {
var EXPORTED_SYMBOLS = ["JSMLoader"];
var global = this;
var storage = Components.classes["@mozilla.org/fuel/application;1"]
.getService(Components.interfaces.fuelIApplication)
.storage;
var JSMLoader = storage.get("dactyl.JSMLoader", undefined);
var BOOTSTRAP_CONTRACT = "@dactyl.googlecode.com/base/bootstrap";
var JSMLoader = BOOTSTRAP_CONTRACT in Components.classes &&
Components.classes[BOOTSTRAP_CONTRACT].getService().wrappedJSObject;
if (!JSMLoader || JSMLoader.bump != 4)
JSMLoader = {
@@ -25,14 +24,11 @@ if (!JSMLoader || JSMLoader.bump != 4)
loader: Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader),
manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar),
stale: JSMLoader ? JSMLoader.stale : {},
storage: storage,
suffix: "",
init: function init(suffix) {
this.initialized = true;
this.suffix = suffix || "";
this.storage.set("dactyl.JSMLoader", this);
let base = this.load("base.jsm", global);
global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS;
global.JSMLoader = this;

View File

@@ -57,7 +57,7 @@ var ConfigBase = Class("ConfigBase", {
addon: Class.memoize(function () {
let addon;
do {
addon = services.fuel.storage.get("dactyl.bootstrap", {}).addon;
addon = (JSMLoader.bootstrap || {}).addon;
if (addon && !addon.getResourceURI) {
util.reportError(Error("Don't have add-on yet"));
yield 10;

View File

@@ -41,7 +41,6 @@ var Services = Module("Services", {
this.add("externalProtocol", "@mozilla.org/uriloader/external-protocol-service;1", Ci.nsIExternalProtocolService);
this.add("favicon", "@mozilla.org/browser/favicon-service;1", Ci.nsIFaviconService);
this.add("focus", "@mozilla.org/focus-manager;1", Ci.nsIFocusManager);
this.add("fuel", "@mozilla.org/fuel/application;1", Ci.extIApplication);
this.add("history", "@mozilla.org/browser/global-history;2",
[Ci.nsIBrowserHistory, Ci.nsIGlobalHistory3, Ci.nsINavHistoryService, Ci.nsPIPlacesDatabase]);
this.add("io", "@mozilla.org/network/io-service;1", Ci.nsIIOService);

View File

@@ -1414,8 +1414,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
}),
rehash: function (args) {
if (services.fuel)
services.fuel.storage.set("dactyl.commandlineArgs", args);
JSMLoader.commandlineArgs = args;
this.timeout(function () {
this.rehashing = true;
let addon = config.addon;