mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 381517 - Download manager fails when it should probably just ignore the failure. r=sdwilsh, a=mconnor
This commit is contained in:
parent
6607ea668e
commit
8228d45f3f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user