зеркало из https://github.com/mozilla/pjs.git
Bug 401430: download manager 'add to recent docs' functionality (Windows) isn't working, r=sdwilsh
This commit is contained in:
Родитель
a03a0fe47d
Коммит
d241795247
|
@ -1828,7 +1828,9 @@ nsDownload::SetState(DownloadState aState)
|
|||
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
|
||||
nsCOMPtr<nsIFile> file;
|
||||
nsAutoString path;
|
||||
if (fileURL && fileURL->GetFile(getter_AddRefs(file)) && file &&
|
||||
if (fileURL &&
|
||||
NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
|
||||
file &&
|
||||
NS_SUCCEEDED(file->GetPath(path))) {
|
||||
PRUnichar *filePath = ToNewUnicode(path);
|
||||
LPITEMIDLIST lpItemIDList = NULL;
|
||||
|
|
|
@ -106,7 +106,12 @@ function cleanup()
|
|||
}
|
||||
|
||||
var gDownloadCount = 0;
|
||||
function addDownload()
|
||||
/**
|
||||
* Adds a download to the DM, and starts it.
|
||||
* @param aResultFileName (optional): the leafName of the download's target
|
||||
* file.
|
||||
*/
|
||||
function addDownload(aResultFileName)
|
||||
{
|
||||
const nsIWBP = Ci.nsIWebBrowserPersist;
|
||||
var persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
|
||||
|
@ -116,7 +121,7 @@ function addDownload()
|
|||
nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
|
||||
|
||||
var destFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
destFile.append("download.result");
|
||||
destFile.append(aResultFileName || "download.result");
|
||||
var srcFile = dirSvc.get("ProfD", Ci.nsIFile);
|
||||
srcFile.append("LICENSE");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче