Bug 401430: download manager 'add to recent docs' functionality (Windows) isn't working, r=sdwilsh

This commit is contained in:
gavin%gavinsharp.com 2007-10-30 18:31:50 +00:00
Родитель a03a0fe47d
Коммит d241795247
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -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");