diff options
author | Damiano Galassi <[email protected]> | 2018-06-08 16:59:25 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2018-06-08 16:59:25 +0200 |
commit | c762b2c0ec5b6fb58d1fd453e2b5aed526c6d693 (patch) | |
tree | e0ab43c5ddd28ed876158b689be0c93c2380d970 /macosx/HBOutputFileWriter.m | |
parent | de7355d5ad5257c4cce5e0a99fffb3ee58264ba0 (diff) |
MacGui: set the minimum deployment target to 10.10. Remove Growl and use macOS standard notifications. Remove deprecated API usage and code that doesn't compile anymore (QTKit).
Diffstat (limited to 'macosx/HBOutputFileWriter.m')
-rw-r--r-- | macosx/HBOutputFileWriter.m | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/macosx/HBOutputFileWriter.m b/macosx/HBOutputFileWriter.m index fffe9478b..cbd4e9977 100644 --- a/macosx/HBOutputFileWriter.m +++ b/macosx/HBOutputFileWriter.m @@ -10,6 +10,7 @@ @implementation HBOutputFileWriter { FILE *f; + NSDateFormatter *_formatter; } - (nullable instancetype)initWithFileURL:(NSURL *)url; @@ -31,7 +32,7 @@ _url = [url copy]; - f = fopen(url.path.fileSystemRepresentation, "w"); + f = fopen(url.fileSystemRepresentation, "w"); if (!f) { return nil; @@ -43,6 +44,11 @@ return nil; } + _formatter = [[NSDateFormatter alloc] init]; + _formatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]; + _formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ssZZZZZ"; + _formatter.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; + [self writeHeaderForReason:@"Session"]; } @@ -58,7 +64,7 @@ { [self write:[NSString stringWithFormat:@"HandBrake Activity Log for %@: %@\n%@\n", reason, - [[NSDate date] descriptionWithCalendarFormat:nil timeZone:nil locale:nil], + [_formatter stringFromDate:[NSDate date]], [HBUtilities handBrakeVersion]]]; } |