mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 16:32:27 +01:00
Adding hostname to the tmp file used with external editor
This commit is contained in:
@@ -458,19 +458,20 @@ liberator.IO = function () //{{{
|
|||||||
var file = Components.classes["@mozilla.org/file/local;1"]
|
var file = Components.classes["@mozilla.org/file/local;1"]
|
||||||
.createInstance(Components.interfaces.nsILocalFile);
|
.createInstance(Components.interfaces.nsILocalFile);
|
||||||
|
|
||||||
var tmpname = liberator.config.name.toLowerCase() + ".tmp";
|
var tmpname = liberator.config.name.toLowerCase() + "-" +
|
||||||
|
window.content.document.location.hostname + ".tmp";
|
||||||
if (liberator.config.name == "Muttator")
|
if (liberator.config.name == "Muttator")
|
||||||
tmpname = "mutt-ator-mail"; // to allow vim to :set ft=mail automatically
|
tmpname = "mutt-ator-mail"; // to allow vim to :set ft=mail automatically
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
{
|
{
|
||||||
var dir = environmentService.get("TMP") || environmentService.get("TEMP") || "C:\\";
|
var dir = environmentService.get("TMP") || environmentService.get("TEMP") || "C:\\";
|
||||||
file.initWithPath(dir + "\\" + tmpname);
|
file.initWithPath(dir + tmpname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var dir = environmentService.get("TMP") || environmentService.get("TEMP") || "/tmp/";
|
var dir = environmentService.get("TMP") || environmentService.get("TEMP") || "/tmp/";
|
||||||
file.initWithPath(dir + "/" + tmpname);
|
file.initWithPath(dir + tmpname);
|
||||||
}
|
}
|
||||||
|
|
||||||
file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);
|
file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);
|
||||||
|
|||||||
Reference in New Issue
Block a user