diff options
author | Damiano Galassi <[email protected]> | 2016-01-28 07:32:16 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2016-01-28 07:32:16 +0100 |
commit | a37f528f742c2b27db3995c7b22147d9ef4d7049 (patch) | |
tree | 30e407ff65c15012425ba0f5379bde8d5a53634d /macosx | |
parent | aa9e61d194f5b2a9f54f49067eb85d2655feb20d (diff) |
MacGui: fix some static anaylizer warnings.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBAudioTrack.h | 8 | ||||
-rw-r--r-- | macosx/HBController.m | 11 | ||||
-rw-r--r-- | macosx/HBPresetsManager.m | 4 |
3 files changed, 14 insertions, 9 deletions
diff --git a/macosx/HBAudioTrack.h b/macosx/HBAudioTrack.h index 7bf5c8ecc..c259812e8 100644 --- a/macosx/HBAudioTrack.h +++ b/macosx/HBAudioTrack.h @@ -46,9 +46,9 @@ extern NSString *keyAudioBitrate; @property (nonatomic, strong) NSDictionary *track; @property (nonatomic, strong, nullable) NSDictionary *codec; -@property (nonatomic, strong) NSDictionary *mixdown; -@property (nonatomic, strong) NSDictionary *sampleRate; -@property (nonatomic, strong) NSDictionary *bitRate; +@property (nonatomic, strong, nullable) NSDictionary *mixdown; +@property (nonatomic, strong, nullable) NSDictionary *sampleRate; +@property (nonatomic, strong, nullable) NSDictionary *bitRate; @property (nonatomic) double drc; @property (nonatomic) double gain; @property (nonatomic) int container; @@ -63,7 +63,7 @@ extern NSString *keyAudioBitrate; @property (nonatomic, readonly) BOOL enabled; - (void) setTrackFromIndex: (int) aValue; -- (BOOL) setCodecFromName: (NSString *) aValue; +- (BOOL) setCodecFromName: (nullable NSString *) aValue; - (void) setMixdownFromName: (NSString *) aValue; - (void) setSampleRateFromName: (NSString *) aValue; - (void) setBitRateFromName: (NSString *) aValue; diff --git a/macosx/HBController.m b/macosx/HBController.m index 94f626b7f..923256a45 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -845,7 +845,7 @@ { [self updateFileExtension:nil]; - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"]) + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"] && self.job) { // Generate a new file name NSString *fileName = [HBUtilities automaticNameForJob:self.job]; @@ -858,10 +858,13 @@ - (void)updateFileExtension:(NSNotification *)notification { - NSString *extension = [HBUtilities automaticExtForJob:self.job]; - if (![extension isEqualTo:self.job.destURL.pathExtension]) + if (self.job) { - self.job.destURL = [[self.job.destURL URLByDeletingPathExtension] URLByAppendingPathExtension:extension]; + NSString *extension = [HBUtilities automaticExtForJob:self.job]; + if (![extension isEqualTo:self.job.destURL.pathExtension]) + { + self.job.destURL = [[self.job.destURL URLByDeletingPathExtension] URLByAppendingPathExtension:extension]; + } } } diff --git a/macosx/HBPresetsManager.m b/macosx/HBPresetsManager.m index 275d79706..aa78455ff 100644 --- a/macosx/HBPresetsManager.m +++ b/macosx/HBPresetsManager.m @@ -84,7 +84,9 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification"; int major, minor, micro; hb_presets_current_version(&major, &minor, µ); - if ([dict[@"VersionMajor"] intValue] > major) + if ([dict[@"VersionMajor"] intValue] > major || + ([dict[@"VersionMajor"] intValue] == major && [dict[@"VersionMinor"] intValue] > minor) || + ([dict[@"VersionMajor"] intValue] == major && [dict[@"VersionMinor"] intValue] == minor && [dict[@"VersionMicro"] intValue] > micro)) { return YES; } |