Bug 1723811 - Port bug 1723723 to Thunderbird - Switch JS consumers from getURLSpecFromFile to either getURLSpecFromActualFile or getURLSpecFromDir. r=lasana
Differential Revision: https://phabricator.services.mozilla.com/D121663 --HG-- extra : rebase_source : 2f8ecb0b1b44af661bf7e8d3b2e8d5004f018d33 extra : amend_source : 6b66c679a44e82464bd338bfa3ea7a6a0b66c30f
This commit is contained in:
Родитель
5499d10e81
Коммит
7c4b355d3a
|
@ -2160,7 +2160,7 @@ function attachFile(cloudProvider) {
|
|||
let fileHandler = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
let uriSpec = fileHandler.getURLSpecFromFile(file);
|
||||
let uriSpec = fileHandler.getURLSpecFromActualFile(file);
|
||||
|
||||
if (!(uriSpec in gAttachMap)) {
|
||||
// If the attachment hasn't been added, then set the last display
|
||||
|
|
|
@ -552,7 +552,7 @@ MailDefaultHandler.prototype = {
|
|||
try {
|
||||
// Unescape the URI so that we work with clients that escape spaces.
|
||||
localFile.initWithPath(unescape(uri));
|
||||
attachment.url = fileHandler.getURLSpecFromFile(localFile);
|
||||
attachment.url = fileHandler.getURLSpecFromActualFile(localFile);
|
||||
composeFields.addAttachment(attachment);
|
||||
|
||||
msgParams.type = Ci.nsIMsgCompType.New;
|
||||
|
|
|
@ -1283,7 +1283,7 @@ var filePhotoHandler = {
|
|||
let photoSpec = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler)
|
||||
.getURLSpecFromFile(photoFile);
|
||||
.getURLSpecFromActualFile(photoFile);
|
||||
photoElem.style.backgroundImage =
|
||||
"url(moz-icon://" + photoSpec + "?size=16)";
|
||||
photoElem.value = photoFile.leafName;
|
||||
|
|
|
@ -649,7 +649,7 @@ function PromptForSaveLocation(
|
|||
if (rv != nsIFilePicker.returnCancel && fp.file) {
|
||||
// Allow OK and replace.
|
||||
// reset urlstring to new save location
|
||||
dialogResult.resultingURIString = fileHandler.getURLSpecFromFile(
|
||||
dialogResult.resultingURIString = fileHandler.getURLSpecFromActualFile(
|
||||
fp.file
|
||||
);
|
||||
dialogResult.resultingLocalFile = fp.file;
|
||||
|
|
|
@ -6317,7 +6317,7 @@ function FileToAttachment(file) {
|
|||
"@mozilla.org/messengercompose/attachment;1"
|
||||
].createInstance(Ci.nsIMsgAttachment);
|
||||
|
||||
attachment.url = fileHandler.getURLSpecFromFile(file);
|
||||
attachment.url = fileHandler.getURLSpecFromActualFile(file);
|
||||
attachment.size = file.fileSize;
|
||||
return attachment;
|
||||
}
|
||||
|
@ -8206,7 +8206,7 @@ var envelopeDragObserver = {
|
|||
data = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler)
|
||||
.getURLSpecFromFile(data);
|
||||
.getURLSpecFromActualFile(data);
|
||||
isValidAttachment = true;
|
||||
} catch (e) {
|
||||
Cu.reportError(
|
||||
|
|
|
@ -113,7 +113,7 @@ var gDownloadDirSection = {
|
|||
let urlSpec = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler)
|
||||
.getURLSpecFromFile(downloadDir);
|
||||
.getURLSpecFromDir(downloadDir);
|
||||
|
||||
downloadFolder.style.backgroundImage =
|
||||
"url(moz-icon://" + urlSpec + "?size=16)";
|
||||
|
|
|
@ -1890,7 +1890,7 @@ var gGeneralPane = {
|
|||
let urlSpec = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler)
|
||||
.getURLSpecFromFile(aFile);
|
||||
.getURLSpecFromActualFile(aFile);
|
||||
|
||||
return "moz-icon://" + urlSpec + "?size=16";
|
||||
},
|
||||
|
|
|
@ -297,7 +297,7 @@ add_task(function test_open_attachment() {
|
|||
let fileHandler = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
let url = fileHandler.getURLSpecFromFile(file);
|
||||
let url = fileHandler.getURLSpecFromActualFile(file);
|
||||
let size = file.fileSize;
|
||||
|
||||
add_attachments(cwc, url, size);
|
||||
|
|
|
@ -97,7 +97,7 @@ add_task(async function test_paste_file_urls() {
|
|||
tmpFile.initWithPath(dest);
|
||||
Assert.ok(tmpFile.exists(), "tmpFile's not there at " + dest);
|
||||
|
||||
tmpFileURL = fileHandler.getURLSpecFromFile(tmpFile);
|
||||
tmpFileURL = fileHandler.getURLSpecFromActualFile(tmpFile);
|
||||
putHTMLOnClipboard(
|
||||
"<img id='bad-img' src='file://foo/non-existent' alt='bad' /> and " +
|
||||
"<img id='tmp-img' src='" +
|
||||
|
|
|
@ -91,7 +91,7 @@ add_task(function test_basic_multipart_related() {
|
|||
let fileHandler = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
let fileURL = fileHandler.getURLSpecFromFile(file);
|
||||
let fileURL = fileHandler.getURLSpecFromActualFile(file);
|
||||
|
||||
// Add a simple image to our dialog
|
||||
plan_for_modal_dialog("Mail:image", function(dialog) {
|
||||
|
|
|
@ -148,7 +148,7 @@ function create_detached_attachment(file, type) {
|
|||
let fileHandler = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
let url = fileHandler.getURLSpecFromFile(file);
|
||||
let url = fileHandler.getURLSpecFromActualFile(file);
|
||||
let filename = file.leafName;
|
||||
|
||||
let str =
|
||||
|
|
Загрузка…
Ссылка в новой задаче