summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewGenerator.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-07-31 17:11:14 +0000
committerritsuka <[email protected]>2014-07-31 17:11:14 +0000
commitc229708133e2b74931def4da7403d2ceb5a24b21 (patch)
treea67625634abbd986de3c0dbacbf1f29736317d47 /macosx/HBPreviewGenerator.m
parentf91c7a92b91205c8412283865583a54529a18568 (diff)
MacGui: removed another duplicated method to get the Application Support path.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6252 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreviewGenerator.m')
-rw-r--r--macosx/HBPreviewGenerator.m20
1 files changed, 2 insertions, 18 deletions
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m
index 2ea7b2aad..64effac2c 100644
--- a/macosx/HBPreviewGenerator.m
+++ b/macosx/HBPreviewGenerator.m
@@ -6,6 +6,7 @@
//
#import "HBPreviewGenerator.h"
+#import "HBUtilities.h"
#import "Controller.h"
typedef enum EncodeState : NSUInteger {
@@ -162,26 +163,9 @@ typedef enum EncodeState : NSUInteger {
#pragma mark -
#pragma mark Preview movie
-+ (NSString *) appSupportPath
-{
- NSFileManager *fileManager = [NSFileManager defaultManager];
- NSString *appSupportPath = nil;
-
- NSArray *allPaths = NSSearchPathForDirectoriesInDomains( NSApplicationSupportDirectory,
- NSUserDomainMask,
- YES );
- if ([allPaths count])
- appSupportPath = [[allPaths objectAtIndex:0] stringByAppendingPathComponent:@"HandBrake"];
-
- if (![fileManager fileExistsAtPath:appSupportPath])
- [fileManager createDirectoryAtPath:appSupportPath withIntermediateDirectories:YES attributes:nil error:NULL];
-
- return appSupportPath;
-}
-
+ (NSURL *) generateFileURLForType:(NSString *) type
{
- NSString *previewDirectory = [NSString stringWithFormat:@"%@/Previews/%d", [HBPreviewGenerator appSupportPath], getpid()];
+ NSString *previewDirectory = [NSString stringWithFormat:@"%@/Previews/%d", [HBUtilities appSupportPath], getpid()];
if (![[NSFileManager defaultManager] fileExistsAtPath:previewDirectory])
{