Closed Bug 341701 Opened 18 years ago Closed 18 years ago

"When Camino Quits" removes cancelled downloads, not just successful one

Categories

(Camino Graveyard :: Downloading, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Camino1.5

People

(Reporter: alqahira, Assigned: nick.kreeger)

Details

(Keywords: fixed1.8.1)

Attachments

(2 files, 1 obsolete file)

Some time ago Kreeger fixed things so that cancelled downloads didn't get tossed from the downloads list, in preparation for using them as a placeholder for the url for a complete restart/retry (bug 303158) and for true resume-from-interrupt-point-using-.part (bug 215343).

Bug 308942 broke this (and I forgot to test this scenario); cancelled downloads are now removed on quit (was this pink's bug 308942 comment 57?).
When we fix this, we should also reword the pref text to include the word "successful" (or similar) to clarify, and change the "Upon successful download" option text to be "When the download finishes" (or "is complete" or similar) to eliminate redundancy.
(In reply to comment #0)
> Some time ago Kreeger fixed things so that cancelled downloads didn't get
> tossed from the downloads list, in preparation for using them as a placeholder
> for the url for a complete restart/retry (bug 303158) and for true
> resume-from-interrupt-point-using-.part (bug 215343).
> 
> Bug 308942 broke this (and I forgot to test this scenario); cancelled downloads
> are now removed on quit (was this pink's bug 308942 comment 57?).
> 

Should "tossed from the downloads list" refer to clean up or remove?
Either way, the clean up action removes downloads that are cancelled.

Taking
Assignee: nobody → nick.kreeger
"Tossed from the downloads list" in comment 0 refers to the bug you fixed, pre-pause/resume, to make the downloads list persist on quit.

The issue here is that one of the automatic removal options removes only successfully completed downloads ("on completion") whereas the other automatic option removes all downloads ("on quit"), even cancelled/interrupted ones you might want to keep to retry or later resume.

"Remove" and "Clean Up" are both manual operations (and don't apply here), and you're specifically telling Camino to either remove a single item or all of them, regardless of state (well, not active ones).  You manually initiated it, and you know it's going to happen (and there's a way to not delete cancelled/interrupted ones you want to retry later).  With the automatic pref, you don't know it's going to delete cancelled/interrupted ones, at least not consistently, and there's no easy way to prevent it in the one case where it does delete them all.
Attached patch Patch (obsolete) — Splinter Review
Proposed patch, rather than deleting the plist, just remove the successful downloads from the list and then save.
Attachment #227408 - Flags: review?(hwaara)
Comment on attachment 227408 [details] [diff] [review]
Patch

>+    // If the download either failed or was cancelled, add it to the list to save

This comment would be easier to understand if it was "Remove successful downloads..." etc.

>+-(BOOL)isFailed
>+{
>+  return mDownloadingError;
>+}

I had to check if this was a NSString* (which I think it sounds like). How about renaming it to mDownloadFailed since it's a boolean?

r+ with the first and optionally the last comment addressed.
Attachment #227408 - Flags: review?(hwaara) → review+
Attached patch Updated PatchSplinter Review
This patch address the two comments from hwarra
Attachment #227408 - Attachment is obsolete: true
Attachment #227412 - Flags: superreview?(mikepinkerton)
+  while  ((curProgView = [downloadsEnum nextObject]))
+  {
+    // Remove successful downloads from the list
+    if (![curProgView isFailed] && ![curProgView isCanceled])

fix spacing on while.

should we be asking failed or succeeded? usually the affirmative is easier to understand but that's the opposite logic of iscancelled...

Attached patch Option BSplinter Review
Pink this moves the logic to another method called |hasSucceeded:| in ProgressViewController to make the call in ProgressDlgController cleaner.

Also fixed the space issue on the while loop
Comment on attachment 227418 [details] [diff] [review]
Option B

flows better, i think. sr=pink
Attachment #227418 - Flags: superreview+
Fixed trunk und Branch
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: regressionfixed1.8.1
Resolution: --- → FIXED
Attachment #227412 - Flags: superreview?(mikepinkerton)
v. on the trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: