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

Fix the info path in liberator.startup.

This commit is contained in:
anekos
2009-01-03 09:42:24 +09:00
parent 5d1f9db967
commit 3263b34a8b

View File

@@ -605,6 +605,16 @@ const liberator = (function () //{{{
// ###VERSION### and ###DATE### are replaced by the Makefile // ###VERSION### and ###DATE### are replaced by the Makefile
version: "###VERSION### (created: ###DATE###)", version: "###VERSION### (created: ###DATE###)",
// services.get("profile").selectedProfile.name is not rightness.
// If default profile Firefox runs without arguments,
// then selectedProfile returns last selected profile! (not current one!)
profileName: (function () {
let WINDOWS = getPlatformFeature() === "Win32";
let directoryService = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties);
let profilePath = directoryService.get('ProfD', Ci.nsIFile).path;
return profilePath.replace(WINDOWS ? /^.*[\\]/ : /^.*[\/]/, '').replace(/^.+?\./, '');
})(),
// TODO: move to events.js? // TODO: move to events.js?
input: { input: {
buffer: "", // partial command storage buffer: "", // partial command storage
@@ -1237,7 +1247,7 @@ const liberator = (function () //{{{
let infoPath = services.create("file"); let infoPath = services.create("file");
infoPath.initWithPath(IO.expandPath(IO.runtimePath.replace(/,.*/, ""))); infoPath.initWithPath(IO.expandPath(IO.runtimePath.replace(/,.*/, "")));
infoPath.append("info"); infoPath.append("info");
infoPath.append(services.get("profile").selectedProfile.name); infoPath.append(liberator.profileName);
storage.infoPath = infoPath; storage.infoPath = infoPath;
} }
catch (e) catch (e)