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.

This commit is contained in:
ben%bengoodger.com 2004-10-04 07:07:31 +00:00
Родитель a168bfa5c1
Коммит ff1c535328
2 изменённых файлов: 1 добавлений и 21 удалений

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

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

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

@ -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();
}