[Conkeror] [PATCH 1/2] download manager: show display name, allow target file name to change

David Kettler kettler at internode.on.net
Sun Feb 22 03:55:50 PST 2009


>   I am having problems downloading files since "download manager: show
> display name, allow target file name to change".  The file downloads in
> the background, but I get no download buffer, and conkeror spews errors:
> 
> error: encountered unknown download in progress change
> error: encountered unknown download in progress change
> error: encountered unknown download in progress change

Sorry, John, I broke it.  I've just pushed a fix.  See commit message 
included below for further info.

>   I was noticing that even before these patches, mozilla used a
> temporary file with the extension ".part" while downloading a file.  So
> I am not sure that your adding explicit support for a temp file was even
> necessary.  What's your experience on this?

I hadn't realized that there are two ways to save files.  The save
command uses the saveURI method of nsWebBrowserPersist, while visiting
a download link ends up using the saveToDisk method of
nsIHelperAppLauncherDialog.  The latter does the .part thing.  I was
aware of the functionality from having previously used iceape, but I
didn't realize that it is in the xul code that conkeror uses too.  The
saveURI method does not offer anything similar, so I implemented the
temp file work around.  If save_uri could use the
nsIHelperAppLauncherDialog method then my temp file code won't be
needed.  That would be great.

regards, David.


--8<--

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).




More information about the Conkeror mailing list