download manager: display downloads properly again
commitecb3492e1561ee9ffca959eaa684e58c390dc03c
authorDavid Kettler <kettler@internode.on.net>
Sun, 22 Feb 2009 11:40:14 +0000 (22 22:10 +1030)
committerDavid Kettler <kettler@internode.on.net>
Sun, 22 Feb 2009 11:40:14 +0000 (22 22:10 +1030)
treea93a350f775a2ccd1812c5958d9e32fcc301f429
parente781b83791b688b815d1c6c45f471f1bb9f3aa5c
download manager: display downloads properly again

Commit 080e20e (download manager: show display name, allow target file
name to change, 2009-02-18) broke the download manager display of most
downloads.

There are two separate interfaces for downloading files that use
different methods; (1) the save interactive command and (2) choosing
"save" in response to the "Action to perform" prompt when visiting a
download url.  That commit was tested for case (1) but not case (2).

The one line of code changed in this commit had two errors;
this.mozilla_info was not yet set (it is set a couple of lines later)
and mozilla_info.targetFile is not set at the time that attach() is
called.

The fix restores the previous behaviour of target_file being a getter,
if it is not already set.

It may be that the two methods could be changed to use the same
underlying interface and so simplify this code and obviate the need
for the changes in commit 9645e93 (save_uri: optionally use a
temporary download file, 2009-02-18).
modules/download-manager.js