Changeset 14341 for trunk/macosx/InfoActivityViewController.m
- Timestamp:
- Oct 17, 2014, 5:12:00 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/InfoActivityViewController.m
r14052 r14341 24 24 25 25 #import "InfoActivityViewController.h" 26 #import "NSApplicationAdditions.h" 26 27 #import "NSStringAdditions.h" 27 28 #import "PiecesView.h" … … 186 187 [fDateAddedField setObjectValue: [torrent dateAdded]]; 187 188 188 [fDownloadTimeField setStringValue: [NSString timeString: [torrent secondsDownloading] showSeconds: YES]]; 189 [fSeedTimeField setStringValue: [NSString timeString: [torrent secondsSeeding] showSeconds: YES]]; 189 if ([NSApp isOnYosemiteOrBetter]) { 190 static NSDateComponentsFormatter *timeFormatter; 191 static dispatch_once_t onceToken; 192 dispatch_once(&onceToken, ^{ 193 timeFormatter = [NSDateComponentsFormatter new]; 194 timeFormatter.unitsStyle = NSDateComponentsFormatterUnitsStyleShort; 195 timeFormatter.allowedUnits = NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; 196 timeFormatter.zeroFormattingBehavior = NSDateComponentsFormatterZeroFormattingBehaviorDropLeading; 197 }); 198 199 [fDownloadTimeField setStringValue: [timeFormatter stringFromTimeInterval:[torrent secondsDownloading]]]; 200 [fSeedTimeField setStringValue: [timeFormatter stringFromTimeInterval:[torrent secondsSeeding]]]; 201 } 202 else { 203 [fDownloadTimeField setStringValue: [NSString timeString: [torrent secondsDownloading] includesTimeRemainingPhrase:NO showSeconds: YES]]; 204 [fSeedTimeField setStringValue: [NSString timeString: [torrent secondsSeeding] includesTimeRemainingPhrase:NO showSeconds: YES]]; 205 } 190 206 191 207 [fPiecesView updateView];
Note: See TracChangeset
for help on using the changeset viewer.