Ensure browser.download.manager.openDelay works when set to 0...

This commit is contained in:
ben%bengoodger.com 2004-03-04 01:11:54 +00:00
parent 40806fd1ab
commit 371d364621

View File

@ -1093,6 +1093,8 @@ nsDownloadManager::Open(nsIDOMWindow* aParent, const PRUnichar* aPath)
if (pref)
pref->GetIntPref(PREF_BDM_OPENDELAY, &delay);
params->AppendElement((void*)&delay);
// 3). Look for an existing Download Manager window, if we find one we just
// tell it that a new download has begun (we don't focus, that's
// annoying), otherwise we need to open the window. We do this on a timer
@ -1110,13 +1112,14 @@ nsDownloadManager::OpenTimerCallback(nsITimer* aTimer, void* aClosure)
nsVoidArray* params = (nsVoidArray*)aClosure;
nsIDOMWindow* parent = (nsIDOMWindow*)params->ElementAt(0);
nsDownload* download = (nsDownload*)params->ElementAt(1);
PRInt32 openDelay = *(PRInt32*)params->ElementAt(2);
PRInt32 complete;
download->GetPercentComplete(&complete);
// We only show the download window if the download is taking more than a non-tiny
// amount of time to complete.
if (complete < 100) {
if (!openDelay || complete < 100) {
PRBool focusDM = PR_FALSE;
PRBool showDM = PR_TRUE;
PRInt32 flashCount = -1;