1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 10:47:59 +01:00

Fix issue in revision 2505a62b7c53. Closes issue #175.

This commit is contained in:
Kris Maglione
2010-12-10 18:46:27 -05:00
parent 1c734e6709
commit 272cbc5c66
2 changed files with 13 additions and 13 deletions

View File

@@ -89,11 +89,12 @@ function Dactyl() {
this.HELP_TAGS = {}; this.HELP_TAGS = {};
this.FILE_MAP = {}; this.FILE_MAP = {};
this.OVERLAY_MAP = {}; this.OVERLAY_MAP = {};
this.addonID = this.name + "@dactyl.googlecode.com";
this.pages = {}; this.pages = {};
for each (let pref in ["appName", "fileExt", "host", "hostbin", "idName", "name"]) for each (let pref in ["appName", "fileExt", "host", "hostbin", "idName", "name"])
this[pref] = prefs.getComplexValue(pref, Ci.nsISupportsString).data; this[pref] = prefs.getComplexValue(pref, Ci.nsISupportsString).data;
this.addonID = this.name + "@dactyl.googlecode.com";
} }
Dactyl.prototype = { Dactyl.prototype = {
contractID: "@mozilla.org/network/protocol;1?name=dactyl", contractID: "@mozilla.org/network/protocol;1?name=dactyl",

View File

@@ -1096,17 +1096,16 @@ const Dactyl = Module("dactyl", {
let save = ["forceNewTab", "forceNewWindow"]; let save = ["forceNewTab", "forceNewWindow"];
let saved = save.map(function (p) dactyl[p]); let saved = save.map(function (p) dactyl[p]);
return function wrappedCallback() { return function wrappedCallback() {
let vals = save.map(function (p) dactyl[p]); let args = arguments;
return dactyl.withSavedValues(save, function () {
saved.forEach(function (p, i) dactyl[save[i]] = p); saved.forEach(function (p, i) dactyl[save[i]] = p);
try { try {
return callback.apply(self, arguments); return callback.apply(self, args);
} }
catch (e) { catch (e) {
dactyl.reportError(e, true); dactyl.reportError(e, true);
} }
finally { });
vals.forEach(function (p, i) dactyl[save[i]] = p);
}
} }
}, },
@@ -1546,7 +1545,7 @@ const Dactyl = Module("dactyl", {
else if (file.isReadable() && file.isFile()) else if (file.isReadable() && file.isFile())
AddonManager.getInstallForFile(file, install, "application/x-xpinstall"); AddonManager.getInstallForFile(file, install, "application/x-xpinstall");
else if (file.isDirectory()) else if (file.isDirectory())
dactyl.echomsg("Cannot install a directory: " + file.path.quote(), 0); dactyl.echoerr("Cannot install a directory: " + file.path.quote());
else else
dactyl.echoerr("E484: Can't open file " + file.path); dactyl.echoerr("E484: Can't open file " + file.path);
}, { }, {