Download completed message reports size as '?' if size was unknown whilst downloading. r=kreeger, sr=pink. Patch by Bruce Davidson (mozilla@transoceanic.org.uk)

This commit is contained in:
hwaara%gmail.com 2006-05-27 08:51:05 +00:00
Родитель 6e0e699523
Коммит 1d2f0f2e0f
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -439,6 +439,15 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
statusString = NSLocalizedString(@"DownloadInterrupted", nil);
}
else {
// If the download size was not known then lookup size from the file we downloaded
if (mDownloadSize < 0) {
[self checkFileExists];
if (mFileExists) {
NSDictionary* fattrs = [[NSFileManager defaultManager] fileAttributesAtPath:mDestPath traverseLink:NO];
mDownloadSize = (long long) [fattrs fileSize];
}
}
statusString = [NSString stringWithFormat:NSLocalizedString(@"DownloadCompleted", nil),
[[self class] formatTime:(int)mDownloadTime], [[self class] formatBytes:mDownloadSize]];
}