summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.mm
diff options
context:
space:
mode:
authorritsuka <[email protected]>2008-04-26 11:15:01 +0000
committerritsuka <[email protected]>2008-04-26 11:15:01 +0000
commit37e9599b853d609a4e0c154c3577309596d47417 (patch)
tree583d4172f015362dc3b04e05a07410ae68213362 /macosx/Controller.mm
parentb2814e9bc1c751f44f4d1f79bd1eadb69fc92846 (diff)
MacGUI: Generate the Application Support path using API calls. Patch by blindjimmy.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1445 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.mm')
-rw-r--r--macosx/Controller.mm28
1 files changed, 14 insertions, 14 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 1397e8b28..5dfe3f7a1 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -43,21 +43,21 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
[HBPreferencesController registerUserDefaults];
fHandle = NULL;
+
/* Check for check for the app support directory here as
- * outputPanel needs it right away, as may other future methods
- */
- /* We declare the default NSFileManager into fileManager */
- NSFileManager * fileManager = [NSFileManager defaultManager];
- /* we set the files and support paths here */
- AppSupportDirectory = @"~/Library/Application Support/HandBrake";
- AppSupportDirectory = [AppSupportDirectory stringByExpandingTildeInPath];
- /* We check for the app support directory for handbrake */
- if ([fileManager fileExistsAtPath:AppSupportDirectory] == 0)
- {
- // If it doesnt exist yet, we create it here
- [fileManager createDirectoryAtPath:AppSupportDirectory attributes:nil];
- }
-
+ * outputPanel needs it right away, as may other future methods
+ */
+ NSString *libraryDir = [NSSearchPathForDirectoriesInDomains( NSLibraryDirectory,
+ NSUserDomainMask,
+ YES ) objectAtIndex:0];
+ AppSupportDirectory = [[libraryDir stringByAppendingPathComponent:@"Application Support"]
+ stringByAppendingPathComponent:@"HandBrake"];
+ if( ![[NSFileManager defaultManager] fileExistsAtPath:AppSupportDirectory] )
+ {
+ [[NSFileManager defaultManager] createDirectoryAtPath:AppSupportDirectory
+ attributes:nil];
+ }
+
outputPanel = [[HBOutputPanelController alloc] init];
fPictureController = [[PictureController alloc] initWithDelegate:self];
fQueueController = [[HBQueueController alloc] init];