ios: Disable cover-art views if UICollectionView is not available.

This commit is contained in:
meancoot 2013-02-20 20:10:44 -05:00
parent 1edd531544
commit b36ead4bf8
2 changed files with 10 additions and 7 deletions

View File

@ -808,7 +808,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RetroArch/RetroArch-Prefix.pch";
INFOPLIST_FILE = "RetroArch/RetroArch-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
@ -844,7 +844,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RetroArch/RetroArch-Prefix.pch";
INFOPLIST_FILE = "RetroArch/RetroArch-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",

View File

@ -46,11 +46,14 @@ static NSString* check_path(NSString* path)
{
path = check_path(path);
NSString* coverDir = path ? [path stringByAppendingPathComponent:@".coverart"] : nil;
if (coverDir && ra_ios_is_directory(coverDir) && ra_ios_is_file([coverDir stringByAppendingPathComponent:@"template.png"]))
return [[RADirectoryGrid alloc] initWithPath:path filter:regex];
else
return [[RADirectoryList alloc] initWithPath:path filter:regex];
if ([UICollectionViewController instancesRespondToSelector:@selector(initWithCollectionViewLayout:)])
{
NSString* coverDir = path ? [path stringByAppendingPathComponent:@".coverart"] : nil;
if (coverDir && ra_ios_is_directory(coverDir) && ra_ios_is_file([coverDir stringByAppendingPathComponent:@"template.png"]))
return [[RADirectoryGrid alloc] initWithPath:path filter:regex];
}
return [[RADirectoryList alloc] initWithPath:path filter:regex];
}
- (id)initWithPath:(NSString*)path filter:(NSRegularExpression*)regex