Camino only - Fix latest version of download crasher (bug 351504). r=kreeger sr=josh

This commit is contained in:
stuart.morgan%alumni.case.edu 2007-02-18 03:23:44 +00:00
Родитель d35330c02d
Коммит bf4baa97fe
2 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -649,6 +649,10 @@ static id gSharedProgressController = nil;
-(void)removeDownload:(id <CHDownloadProgressDisplay>)progressDisplay suppressRedraw:(BOOL)suppressRedraw
{
[progressDisplay displayWillBeRemoved];
// This is sometimes called by code that thinks it can continue
// to use |progressDisplay|. Extended the lifetime slightly as a
// band-aid, but this logic should really be reworked.
[[progressDisplay retain] autorelease];
[mProgressViewControllers removeObject:progressDisplay];
if ([mProgressViewControllers count] == 0) {

Просмотреть файл

@ -67,7 +67,7 @@ enum {
-(void)refreshDownloadInfo;
-(void)launchFileIfAppropriate;
-(void)setProgressViewFromDictionary:(NSDictionary*)aDict;
-(void)removeFromDownloadListIfAppropriate;
-(BOOL)shouldRemoveFromDownloadList;
@end
@ -366,7 +366,10 @@ enum {
[self refreshDownloadInfo];
[self launchFileIfAppropriate];
[self removeFromDownloadListIfAppropriate];
if ([self shouldRemoveFromDownloadList])
[mProgressWindowController removeDownload:self suppressRedraw:NO];
else if (!mDownloadFailed)
[self setupFileSystemNotification];
}
}
@ -379,14 +382,13 @@ enum {
}
}
// Remove the download from the view if the pref is set to remove upon successful download
-(void)removeFromDownloadListIfAppropriate
-(BOOL)shouldRemoveFromDownloadList
{
if (![self hasSucceeded])
return NO;
int downloadRemoveActionValue = [[PreferenceManager sharedInstance] getIntPref:"browser.download.downloadRemoveAction"
withSuccess:NULL];
if (!mUserCancelled && !mDownloadFailed && downloadRemoveActionValue == kRemoveUponSuccessfulDownloadPrefValue)
[mProgressWindowController removeDownload:self suppressRedraw:NO];
return (downloadRemoveActionValue == kRemoveUponSuccessfulDownloadPrefValue);
}
// this handles lots of things - all of the status updates
@ -687,8 +689,6 @@ enum {
[self downloadDidEnd];
[mProgressWindowController didEndDownload:self withSuccess:completedOK statusCode:aStatus];
if (completedOK)
[self setupFileSystemNotification];
}
-(void)setProgressTo:(long long)aCurProgress ofMax:(long long)aMaxProgress