summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-02-12 09:29:02 +0100
committerDamiano Galassi <[email protected]>2019-02-12 09:29:02 +0100
commit18077724c32912345d1a61528859f91be6341024 (patch)
tree938eeb09ce96b698e8dd9728881a6e889e74ef69
parentb183dc8e884920228ca1e626a91cce0ea48a6297 (diff)
MacGui: send integerForKey: instead of [objectForKey:] intValue]
-rw-r--r--macosx/HBController.m6
-rw-r--r--macosx/HBCore.h6
-rw-r--r--macosx/HBCore.m4
-rw-r--r--macosx/HBFilters.m2
-rw-r--r--macosx/HBPreviewGenerator.m2
-rw-r--r--macosx/HBQueueController.m2
-rw-r--r--macosx/HBUtilities.m7
7 files changed, 15 insertions, 14 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m
index 15c9a43da..2b64afaaa 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -161,7 +161,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
if (self)
{
// Init libhb
- int loggingLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
+ NSInteger loggingLevel = [[NSUserDefaults standardUserDefaults] integerForKey:@"LoggingLevel"];
_core = [[HBCore alloc] initWithLogLevel:loggingLevel name:@"ScanCore"];
// Inits the controllers
@@ -626,8 +626,8 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
if (canScan)
{
- int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue];
- int min_title_duration_seconds = [[[NSUserDefaults standardUserDefaults] objectForKey:@"MinTitleScanSeconds"] intValue];
+ NSUInteger hb_num_previews = [[NSUserDefaults standardUserDefaults] integerForKey:@"PreviewsNumber"];
+ NSUInteger min_title_duration_seconds = [[NSUserDefaults standardUserDefaults] integerForKey:@"MinTitleScanSeconds"];
[self.core scanURL:mediaURL
titleIndex:index
diff --git a/macosx/HBCore.h b/macosx/HBCore.h
index eb4d3920b..6f8750ab5 100644
--- a/macosx/HBCore.h
+++ b/macosx/HBCore.h
@@ -91,7 +91,7 @@ typedef void (^HBCoreCompletionHandler)(HBCoreResult result);
* @param level the desired libhb logging level.
* @param queue the queue on which the callbacks will be called.
*/
-- (instancetype)initWithLogLevel:(int)level queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithLogLevel:(NSInteger)level queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
/**
* Opens low level HandBrake library. This should be called once before other
@@ -100,12 +100,12 @@ typedef void (^HBCoreCompletionHandler)(HBCoreResult result);
* @param level the desired libhb logging level
* @param name the instance debug name
*/
-- (instancetype)initWithLogLevel:(int)level name:(NSString *)name;
+- (instancetype)initWithLogLevel:(NSInteger)level name:(NSString *)name;
/**
* Log level.
*/
-@property (nonatomic, readwrite) int logLevel;
+@property (nonatomic, readwrite) NSInteger logLevel;
/**
* Set whether system sleep will be disable or not during a scan/encode
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index 3dfdeb476..391153dbb 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -96,7 +96,7 @@ typedef void (^HBCoreCleanupHandler)(void);
return [self initWithLogLevel:0 queue:dispatch_get_main_queue()];
}
-- (instancetype)initWithLogLevel:(int)level queue:(dispatch_queue_t)queue
+- (instancetype)initWithLogLevel:(NSInteger)level queue:(dispatch_queue_t)queue
{
self = [super init];
if (self)
@@ -122,7 +122,7 @@ typedef void (^HBCoreCleanupHandler)(void);
return self;
}
-- (instancetype)initWithLogLevel:(int)level name:(NSString *)name
+- (instancetype)initWithLogLevel:(NSInteger)level name:(NSString *)name
{
self = [self initWithLogLevel:level queue:dispatch_get_main_queue()];
if (self)
diff --git a/macosx/HBFilters.m b/macosx/HBFilters.m
index c6c99d2e5..81cbb0613 100644
--- a/macosx/HBFilters.m
+++ b/macosx/HBFilters.m
@@ -816,7 +816,7 @@ fail:
{
self.notificationsEnabled = NO;
- // If the preset has an objectForKey:@"UsesPictureFilters", and handle the filters here
+ // If the preset has "UsesPictureFilters", handle the filters here
if ([preset[@"UsesPictureFilters"] boolValue])
{
// Deinterlace
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m
index 9f1057b35..efc95e011 100644
--- a/macosx/HBPreviewGenerator.m
+++ b/macosx/HBPreviewGenerator.m
@@ -280,7 +280,7 @@
job.video.twoPass = NO;
// Init the libhb core
- int level = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
+ NSInteger level = [[NSUserDefaults standardUserDefaults] integerForKey:@"LoggingLevel"];
self.core = [[HBCore alloc] initWithLogLevel:level name:@"PreviewCore"];
HBStateFormatter *formatter = [[HBStateFormatter alloc] init];
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index fe603d5ea..dfe824409 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -86,7 +86,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
_dockTile = [[HBDockTile alloc] initWithDockTile:[[NSApplication sharedApplication] dockTile]
image:[[NSApplication sharedApplication] applicationIconImage]];
- int loggingLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
+ NSInteger loggingLevel = [[NSUserDefaults standardUserDefaults] integerForKey:@"LoggingLevel"];
// Init a separate instance of libhb for the queue
_core = [[HBCore alloc] initWithLogLevel:loggingLevel name:@"QueueCore"];
diff --git a/macosx/HBUtilities.m b/macosx/HBUtilities.m
index 68eec8dbe..e6f9c67ec 100644
--- a/macosx/HBUtilities.m
+++ b/macosx/HBUtilities.m
@@ -220,9 +220,10 @@ static NSDateFormatter *_releaseDateFormatter = nil;
BOOL chapterMarkers = (job.chaptersEnabled) &&
(job.range.type != HBRangeTypeChapters || job.range.chapterStart < job.range.chapterStop);
- if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString:@".m4v"] ||
- ((YES == anyCodecAC3 || YES == chapterMarkers) &&
- [[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString:@"Auto"]))
+ NSString *defaultExtension = [[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"];
+
+ if ([defaultExtension isEqualToString:@".m4v"] ||
+ ((YES == anyCodecAC3 || YES == chapterMarkers) && [defaultExtension isEqualToString:@"Auto"]))
{
extension = @"m4v";
}