mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-25 07:53:33 +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),
|
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 () {
|
prefixes: Class.memoize(function () {
|
||||||
let list = Array.map("CASM", function (s) s + "-");
|
let list = Array.map("CASM", function (s) s + "-");
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
if (/pre$/.test(this.addon.version)) {
|
if (/pre$/.test(this.addon.version)) {
|
||||||
let uri = this.addon.getResourceURI("../.hg");
|
let uri = this.addon.getResourceURI("../.hg");
|
||||||
if (uri instanceof Ci.nsIFileURL &&
|
if (uri instanceof Ci.nsIFileURL &&
|
||||||
uri.QueryInterface(Ci.nsIFileURL).file.exists() &&
|
uri.file.exists() &&
|
||||||
io.pathSearch("hg"))
|
io.pathSearch("hg"))
|
||||||
return uri.file.parent.path;
|
return uri.file.parent.path;
|
||||||
}
|
}
|
||||||
@@ -505,10 +505,10 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
StatusLineSecure;[dactyl|highlight] color: black !important; background: #a0a0FF !important; /* light-blue */
|
StatusLineSecure;[dactyl|highlight] color: black !important; background: #a0a0FF !important; /* light-blue */
|
||||||
StatusLineExtended;[dactyl|highlight] color: black !important; background: #a0FFa0 !important; /* light-green */
|
StatusLineExtended;[dactyl|highlight] color: black !important; background: #a0FFa0 !important; /* light-green */
|
||||||
|
|
||||||
TabClose;.tab-close-button
|
!TabClose;.tab-close-button
|
||||||
TabIcon;.tab-icon min-width: 16px;
|
!TabIcon;.tab-icon,.tab-icon-image
|
||||||
TabText;.tab-text
|
!TabText;.tab-text
|
||||||
TabNumber font-weight: bold; margin: 0px; padding-right: .8ex; cursor: default;
|
TabNumber font-weight: bold; margin: 0px; padding-right: .8ex; cursor: default;
|
||||||
TabIconNumber {
|
TabIconNumber {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
this._prefContexts = [];
|
this._prefContexts = [];
|
||||||
|
|
||||||
this.branch = services.pref[defaults ? "getDefaultBranch" : "getBranch"](branch || "");
|
this.branch = services.pref[defaults ? "getDefaultBranch" : "getBranch"](branch || "");
|
||||||
if (this.branch instanceof Ci.nsIPrefBranch2)
|
this.branch instanceof Ci.nsIPrefBranch2;
|
||||||
this.branch.QueryInterface(Ci.nsIPrefBranch2);
|
|
||||||
|
|
||||||
this.defaults = defaults ? this : this.constructor(branch, true);
|
this.defaults = defaults ? this : this.constructor(branch, true);
|
||||||
|
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ var File = Class("File", {
|
|||||||
let file = services.File();
|
let file = services.File();
|
||||||
|
|
||||||
if (path instanceof Ci.nsIFile)
|
if (path instanceof Ci.nsIFile)
|
||||||
file = path.QueryInterface(Ci.nsIFile).clone();
|
file = path.clone();
|
||||||
else if (/file:\/\//.test(path))
|
else if (/file:\/\//.test(path))
|
||||||
file = services["file:"]().getFileFromURLSpec(path);
|
file = services["file:"]().getFileFromURLSpec(path);
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -779,12 +779,12 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
uri = util.newURI(util.fixURI(uri));
|
uri = util.newURI(util.fixURI(uri));
|
||||||
|
|
||||||
if (uri instanceof Ci.nsIFileURL)
|
if (uri instanceof Ci.nsIFileURL)
|
||||||
return File(uri.QueryInterface(Ci.nsIFileURL).file);
|
return File(uri.file);
|
||||||
|
|
||||||
let channel = services.io.newChannelFromURI(uri);
|
let channel = services.io.newChannelFromURI(uri);
|
||||||
channel.cancel(Cr.NS_BINDING_ABORTED);
|
channel.cancel(Cr.NS_BINDING_ABORTED);
|
||||||
if (channel instanceof Ci.nsIFileChannel)
|
if (channel instanceof Ci.nsIFileChannel)
|
||||||
return File(channel.QueryInterface(Ci.nsIFileChannel).file);
|
return File(channel.file);
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user