зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
6e0e699523
Коммит
1d2f0f2e0f
|
@ -439,6 +439,15 @@ static void FileSystemNotificationProc(FNMessage message, OptionBits flags, void
|
||||||
statusString = NSLocalizedString(@"DownloadInterrupted", nil);
|
statusString = NSLocalizedString(@"DownloadInterrupted", nil);
|
||||||
}
|
}
|
||||||
else {
|
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),
|
statusString = [NSString stringWithFormat:NSLocalizedString(@"DownloadCompleted", nil),
|
||||||
[[self class] formatTime:(int)mDownloadTime], [[self class] formatBytes:mDownloadSize]];
|
[[self class] formatTime:(int)mDownloadTime], [[self class] formatBytes:mDownloadSize]];
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче