From 57dbc1b91328c47396e566cf7a85b1adfe6441a1 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 19 Mar 2011 01:12:22 -0400 Subject: [PATCH] Get rid of apparently redundant QIs. --- common/content/mappings.js | 2 +- common/modules/config.jsm | 10 +++++----- common/modules/prefs.jsm | 3 +-- common/modules/storage.jsm | 2 +- common/modules/util.jsm | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common/content/mappings.js b/common/content/mappings.js index eb2cf78e..99b6e9af 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -306,7 +306,7 @@ var Mappings = Module("mappings", { get userHives() this.allHives.filter(function (h) h !== this.builtin, this), - expandLeader: deprecated("expand", function expandLeader(keyString) keyString.replace(//i, options["mapleader"])), + expandLeader: function expandLeader(keyString) keyString.replace(//i, options["mapleader"]), prefixes: Class.memoize(function () { let list = Array.map("CASM", function (s) s + "-"); diff --git a/common/modules/config.jsm b/common/modules/config.jsm index 2aedd70e..310545e6 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -134,7 +134,7 @@ var ConfigBase = Class("ConfigBase", { if (/pre$/.test(this.addon.version)) { let uri = this.addon.getResourceURI("../.hg"); if (uri instanceof Ci.nsIFileURL && - uri.QueryInterface(Ci.nsIFileURL).file.exists() && + uri.file.exists() && io.pathSearch("hg")) return uri.file.parent.path; } @@ -505,10 +505,10 @@ var ConfigBase = Class("ConfigBase", { StatusLineSecure;[dactyl|highlight] color: black !important; background: #a0a0FF !important; /* light-blue */ StatusLineExtended;[dactyl|highlight] color: black !important; background: #a0FFa0 !important; /* light-green */ - TabClose;.tab-close-button - TabIcon;.tab-icon min-width: 16px; - TabText;.tab-text - TabNumber font-weight: bold; margin: 0px; padding-right: .8ex; cursor: default; + !TabClose;.tab-close-button + !TabIcon;.tab-icon,.tab-icon-image + !TabText;.tab-text + TabNumber font-weight: bold; margin: 0px; padding-right: .8ex; cursor: default; TabIconNumber { cursor: default; width: 16px; diff --git a/common/modules/prefs.jsm b/common/modules/prefs.jsm index c1221bbd..e9b85bbb 100644 --- a/common/modules/prefs.jsm +++ b/common/modules/prefs.jsm @@ -24,8 +24,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]) this._prefContexts = []; this.branch = services.pref[defaults ? "getDefaultBranch" : "getBranch"](branch || ""); - if (this.branch instanceof Ci.nsIPrefBranch2) - this.branch.QueryInterface(Ci.nsIPrefBranch2); + this.branch instanceof Ci.nsIPrefBranch2; this.defaults = defaults ? this : this.constructor(branch, true); diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 28ad0e8d..0e69f509 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -294,7 +294,7 @@ var File = Class("File", { let file = services.File(); if (path instanceof Ci.nsIFile) - file = path.QueryInterface(Ci.nsIFile).clone(); + file = path.clone(); else if (/file:\/\//.test(path)) file = services["file:"]().getFileFromURLSpec(path); else { diff --git a/common/modules/util.jsm b/common/modules/util.jsm index daee67aa..b5572d3e 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -779,12 +779,12 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), uri = util.newURI(util.fixURI(uri)); if (uri instanceof Ci.nsIFileURL) - return File(uri.QueryInterface(Ci.nsIFileURL).file); + return File(uri.file); let channel = services.io.newChannelFromURI(uri); channel.cancel(Cr.NS_BINDING_ABORTED); if (channel instanceof Ci.nsIFileChannel) - return File(channel.QueryInterface(Ci.nsIFileChannel).file); + return File(channel.file); } catch (e) {} return null;