Commit a526241e authored by Felix Paul Kühne's avatar Felix Paul Kühne

media library: add documentFolderPath symbol

parent 9103b7e7
......@@ -3,7 +3,7 @@
* MobileMediaLibraryKit
*****************************************************************************
* Copyright (C) 2010 Pierre d'Herbemont
* Copyright (C) 2010-2013 VLC authors and VideoLAN
* Copyright (C) 2010-2014 VLC authors and VideoLAN
* $Id$
*
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
......@@ -25,12 +25,7 @@
#import <CoreData/CoreData.h>
@interface MLMediaLibrary : NSObject {
NSManagedObjectContext *_managedObjectContext;
NSManagedObjectModel *_managedObjectModel;
BOOL _allowNetworkAccess;
}
@interface MLMediaLibrary : NSObject
@property (readonly) BOOL libraryNeedsUpgrade;
@property (nonatomic, strong) id delegate;
......@@ -46,6 +41,7 @@
- (id)createObjectForEntity:(NSString *)entity;
- (void)removeObject:(NSManagedObject *)object;
- (NSString *)thumbnailFolderPath;
- (NSString *)documentFolderPath;
- (void)applicationWillStart;
- (void)applicationWillExit;
......
......@@ -3,7 +3,7 @@
* MobileMediaLibraryKit
*****************************************************************************
* Copyright (C) 2010 Pierre d'Herbemont
* Copyright (C) 2010-2013 VLC authors and VideoLAN
* Copyright (C) 2010-2014 VLC authors and VideoLAN
* $Id$
*
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
......@@ -41,8 +41,14 @@
@interface MLMediaLibrary ()
{
NSManagedObjectContext *_managedObjectContext;
NSManagedObjectModel *_managedObjectModel;
BOOL _allowNetworkAccess;
NSString *_thumbnailFolderPath;
NSString *_databaseFolderPath;
NSString *_documentFolderPath;
}
@end
......@@ -154,6 +160,20 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
return _thumbnailFolderPath;
}
- (NSString *)documentFolderPath
{
if (_documentFolderPath) {
if (_documentFolderPath.length > 0)
return _documentFolderPath;
}
int directory = NSDocumentDirectory;
NSArray *paths = NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
NSURL *url = [NSURL fileURLWithPath:paths[0]];
_documentFolderPath = [url absoluteString];
return _documentFolderPath;
}
- (NSManagedObjectContext *)managedObjectContext
{
if (_managedObjectContext)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment