From: Jay Freeman (saurik) Date: Tue, 25 Nov 2014 23:58:20 +0000 (-0800) Subject: Merge identifier/folder in $pathForFile$inBundle$. X-Git-Tag: v0.9.3916~13 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/c64a462d161790dab1853f812baa872ebec5c7c2 Merge identifier/folder in $pathForFile$inBundle$. --- diff --git a/Library.mm b/Library.mm index 5857687..e30a4dd 100644 --- a/Library.mm +++ b/Library.mm @@ -329,12 +329,13 @@ static NSString *$getTheme$(NSArray *files, NSArray *themes = Themes_) { } // }}} // $pathForFile$inBundle$() {{{ -static NSString *$pathForFile$inBundle$(NSString *file, NSString *identifier, NSString *folder, bool use) { +static NSString *$pathForFile$inBundle$(NSString *file, NSBundle *bundle, bool use) { + NSString *identifier = [bundle bundleIdentifier]; NSMutableArray *names = [NSMutableArray arrayWithCapacity:8]; if (identifier != nil) [names addObject:[NSString stringWithFormat:@"Bundles/%@/%@", identifier, file]]; - if (folder != nil) { + if (NSString *folder = [[bundle bundlePath] lastPathComponent]) { [names addObject:[NSString stringWithFormat:@"Folders/%@/%@", folder, file]]; NSString *base([folder stringByDeletingPathExtension]); if ([base hasSuffix:@"~iphone"]) @@ -370,10 +371,6 @@ static NSString *$pathForFile$inBundle$(NSString *file, NSString *identifier, NS return nil; } - -static NSString *$pathForFile$inBundle$(NSString *file, NSBundle *bundle, bool use) { - return $pathForFile$inBundle$(file, [bundle bundleIdentifier], [[bundle bundlePath] lastPathComponent], use); -} // }}} static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") {