mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-31 22:13:31 +02:00
Move filename calculations from io.createTempFile to config.tempFile.
This commit is contained in:
@@ -120,7 +120,14 @@ const configbase = { //{{{
|
|||||||
* application namespaces which should be loaded before liberator
|
* application namespaces which should be loaded before liberator
|
||||||
* initialization.
|
* initialization.
|
||||||
*/
|
*/
|
||||||
scripts: []
|
scripts: [],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property {string} The leaf name of any temp files created by
|
||||||
|
* {@link io.createTempFile}.
|
||||||
|
*/
|
||||||
|
get tempFile() this.name.toLowerCase() + ".tmp"
|
||||||
|
|
||||||
}; //}}}
|
}; //}}}
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -704,25 +704,9 @@ function IO() //{{{
|
|||||||
*/
|
*/
|
||||||
createTempFile: function ()
|
createTempFile: function ()
|
||||||
{
|
{
|
||||||
let tmpName = EXTENSION_NAME + ".tmp";
|
|
||||||
|
|
||||||
switch (EXTENSION_NAME)
|
|
||||||
{
|
|
||||||
case "muttator":
|
|
||||||
tmpName = "mutt-ator-mail"; // to allow Vim to :set ft=mail automatically
|
|
||||||
break;
|
|
||||||
case "vimperator":
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (window.content.document.location.hostname)
|
|
||||||
tmpName = EXTENSION_NAME + "-" + window.content.document.location.hostname + ".tmp";
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let file = services.get("directory").get("TmpD", Ci.nsIFile);
|
let file = services.get("directory").get("TmpD", Ci.nsIFile);
|
||||||
file.append(tmpName);
|
|
||||||
|
file.append(config.tempFile);
|
||||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
|
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
|
|||||||
@@ -161,6 +161,9 @@ const config = { //{{{
|
|||||||
"tabs.js"
|
"tabs.js"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// to allow Vim to :set ft=mail automatically
|
||||||
|
tempFile: "mutt-ator-mail",
|
||||||
|
|
||||||
init: function ()
|
init: function ()
|
||||||
{
|
{
|
||||||
// don't wait too long when selecting new messages
|
// don't wait too long when selecting new messages
|
||||||
|
|||||||
@@ -141,6 +141,18 @@ const config = { //{{{
|
|||||||
"tabs.js"
|
"tabs.js"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
get tempFile() {
|
||||||
|
let prefix = this.name.toLowerCase();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
prefix += "-" + window.content.document.location.hostname;
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
|
|
||||||
|
return prefix + ".tmp";
|
||||||
|
},
|
||||||
|
|
||||||
init: function ()
|
init: function ()
|
||||||
{
|
{
|
||||||
// TODO: support 'nrformats'? -> probably not worth it --mst
|
// TODO: support 'nrformats'? -> probably not worth it --mst
|
||||||
|
|||||||
Reference in New Issue
Block a user