mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 04:34:12 +01:00
Get rid of apparently redundant QIs.
This commit is contained in:
@@ -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(/<Leader>/i, options["mapleader"])),
|
||||
expandLeader: function expandLeader(keyString) keyString.replace(/<Leader>/i, options["mapleader"]),
|
||||
|
||||
prefixes: Class.memoize(function () {
|
||||
let list = Array.map("CASM", function (s) s + "-");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user