Bug 381517 - Download manager fails when it should probably just ignore the failure. r=sdwilsh, a=mconnor

This commit is contained in:
edward.lee@engineering.uiuc.edu 2007-10-01 12:56:24 -07:00
Родитель 8af99676cf
Коммит 466b531a40
1 изменённых файлов: 12 добавлений и 19 удалений

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

@ -1674,35 +1674,28 @@ nsDownload::SetState(DownloadState aState)
LPSHELLFOLDER lpShellFolder = NULL;
if (SUCCEEDED(::SHGetDesktopFolder(&lpShellFolder))) {
nsresult rv;
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
nsCOMPtr<nsIFile> file;
rv = fileURL->GetFile(getter_AddRefs(file));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString path;
rv = file->GetPath(path);
NS_ENSURE_SUCCESS(rv, rv);
PRUnichar *filePath = ToNewUnicode(path);
LPITEMIDLIST lpItemIDList = NULL;
if (SUCCEEDED(lpShellFolder->ParseDisplayName(NULL, NULL, filePath,
NULL, &lpItemIDList, NULL))) {
::SHAddToRecentDocs(SHARD_PIDL, lpItemIDList);
::CoTaskMemFree(lpItemIDList);
if (fileURL && fileURL->GetFile(getter_AddRefs(file)) && file &&
NS_SUCCEEDED(file->GetPath(path))) {
PRUnichar *filePath = ToNewUnicode(path);
LPITEMIDLIST lpItemIDList = NULL;
if (SUCCEEDED(lpShellFolder->ParseDisplayName(NULL, NULL, filePath,
NULL, &lpItemIDList,
NULL))) {
::SHAddToRecentDocs(SHARD_PIDL, lpItemIDList);
::CoTaskMemFree(lpItemIDList);
}
nsMemory::Free(filePath);
}
nsMemory::Free(filePath);
lpShellFolder->Release();
}
}
#endif
// Now remove the download if the user's retention policy is "Remove when Done"
if (mDownloadManager->GetRetentionBehavior() == 0)
mDownloadManager->RemoveDownload(mID);
}
break;
default: