Closed Bug 282451 Opened 20 years ago Closed 20 years ago

When downloading file which is less than 1MB in size, progress is indicated without total KBytes

Categories

(Toolkit :: Downloads API, defect)

x86
Windows XP
defect
Not set
trivial

Tracking

()

RESOLVED DUPLICATE of bug 259995

People

(Reporter: snaury, Assigned: bugs)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

I found the problem is in file
toolkit.jar:content/mozapps/downloads/DownloadProgressListener.js, which has
problem in function formatKBytes...

[...]
    if (!progressHasMB && !totalHasMB) {
      format = this._statusFormatUnknownKB;
      format = this._replaceInsert(format, 1, aKBytes);
    }
[...]

More logical is to use:

[...]
    if (!progressHasMB && aTotalKBytes == 0) {
      format = this._statusFormatUnknownKB;
      format = this._replaceInsert(format, 1, aKBytes);
    }
    else if (!progressHasMB && !totalHasMB) {
      format = this._statusFormatKBKB;
      format = this._replaceInsert(format, 1, aKBytes);
      format = this._replaceInsert(format, 2, aTotalKBytes);
    }
[...]

I changed it for me, and it worked perfectly. Hope to see this in future FireFox
releases =^_^=

Reproducible: Always

Steps to Reproduce:
1. Click to download a file which is less than one megabyte (or more precisely
less than 1000Kb)
2. Look at the text under progress indicator
Actual Results:  
it was showing <n> KB

Expected Results:  
<n> of <m> KB

I have Download Manager Tweak extension, but as you can see in details,
extension is not the root of the problem

*** This bug has been marked as a duplicate of 259995 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.