attempt at fixing 262478 - remove 'hack' to prevent an unknown problem with helper app launching. also make sure temp file removal never removes directory hierarchies.

git-svn-id: svn://10.0.0.236/trunk@163189 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ben%bengoodger.com 2004-10-04 07:07:31 +00:00
parent 0cdf119a9b
commit 2fb55ed0bd
2 changed files with 1 additions and 21 deletions

View File

@ -547,26 +547,6 @@ nsDownloadManager::AddDownload(DownloadType aDownloadType,
// yet (it's being downloaded) and persistentDescriptor fails on MacOSX for
// non-existent files.
// XXXben - This is not really ideal. If the download is to be handled by a
// helper application, then we want to see if there is a duplicate file
// in place in the temp folder and remove it _NOW_ before the External
// Helper App Service gets a chance to make a unique clone. If we don't,
// the EHAS will create a unique version of the name which will muck
// with our RDF datasource. We can't create a unique name here either,
// because the EHAS isn't smart enough to know that we're fooling with
// it...
nsMIMEInfoHandleAction action = nsIMIMEInfo::saveToDisk;
if (aMIMEInfo) {
aMIMEInfo->GetPreferredAction(&action);
if (action == nsIMIMEInfo::useHelperApp ||
action == nsIMIMEInfo::useSystemDefault) {
PRBool fileExists;
targetFile->Exists(&fileExists);
if (fileExists)
targetFile->Remove(PR_TRUE);
}
}
nsAutoString path;
rv = targetFile->GetPath(path);
if (NS_FAILED(rv)) return rv;

View File

@ -251,7 +251,7 @@ function onDownloadCancel(aEvent)
var f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
f.initWithPath(aEvent.target.id);
if (f.exists())
f.remove(true);
f.remove(false);
gDownloadViewController.onCommandUpdate();
}