MacGUI: use NSFileManager to get the Movies directory URL.
This commit is contained in:
parent
5a625a6762
commit
d9cc5955d7
@ -188,11 +188,9 @@ static void *HBControllerLogLevelContext = &HBControllerLogLevelContext;
|
||||
#else
|
||||
_destinationURL = [NSUserDefaults.standardUserDefaults URLForKey:HBLastDestinationDirectoryURL];
|
||||
#endif
|
||||
|
||||
if (!_destinationURL || [NSFileManager.defaultManager fileExistsAtPath:_destinationURL.path isDirectory:nil] == NO)
|
||||
{
|
||||
_destinationURL = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSMoviesDirectory, NSUserDomainMask, YES) firstObject]
|
||||
isDirectory:YES];
|
||||
_destinationURL = HBUtilities.defaultDestinationURL;
|
||||
}
|
||||
|
||||
#ifdef __SANDBOX_ENABLED__
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
#import "HBPreferencesController.h"
|
||||
|
||||
@import HandBrakeKit.HBUtilities;
|
||||
|
||||
NSString * const HBShowOpenPanelAtLaunch = @"HBShowOpenPanelAtLaunch";
|
||||
NSString * const HBShowSummaryPreview = @"HBShowSummaryPreview";
|
||||
|
||||
@ -77,8 +79,7 @@ NSString * const HBQueueWorkerCounts = @"HBQueueWorkerCounts";
|
||||
*/
|
||||
+ (void)registerUserDefaults
|
||||
{
|
||||
NSString *moviesDirectory = [NSSearchPathForDirectoriesInDomains(NSMoviesDirectory, NSUserDomainMask, YES) firstObject];
|
||||
NSURL *moviesURL = [NSURL fileURLWithPath:moviesDirectory isDirectory:YES];
|
||||
NSURL *moviesURL = HBUtilities.defaultDestinationURL;
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
|
||||
HBShowOpenPanelAtLaunch: @YES,
|
||||
|
@ -24,6 +24,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
+ (nullable NSURL *)appSupportURL;
|
||||
|
||||
/**
|
||||
* Returns the default destination URL
|
||||
*/
|
||||
+ (nullable NSURL *)defaultDestinationURL;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the url of the current version documentation.
|
||||
*/
|
||||
|
@ -35,6 +35,11 @@ static BOOL hb_resolveBookmarks = YES;
|
||||
return appSupportURL;
|
||||
}
|
||||
|
||||
+ (NSURL *)defaultDestinationURL
|
||||
{
|
||||
return [[NSFileManager.defaultManager URLsForDirectory:NSMoviesDirectory inDomains:NSUserDomainMask] firstObject];
|
||||
}
|
||||
|
||||
+ (NSURL *)documentationURL
|
||||
{
|
||||
return [NSURL URLWithString:@"https://handbrake.fr/docs/en/1.3.0/"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user