]> git.saurik.com Git - winterboard.git/commitdiff
Move double-theme protection into bundleWithFile:.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 4 Dec 2014 08:54:35 +0000 (00:54 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 4 Dec 2014 09:12:36 +0000 (01:12 -0800)
Library.mm

index 3372ddd69ca105959f1e04033277880404076df0..016eaca6c06f0bcd2a896e5df757a3bc51839017 100644 (file)
@@ -492,7 +492,7 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") {
 
 @implementation NSBundle (WinterBoard)
 
-+ (NSBundle *) wb$bundleWithFile:(NSString *)path {
++ (NSBundle *) _wb$bundleWithFile:(NSString *)path {
     path = [path stringByDeletingLastPathComponent];
     if (path == nil || [path length] == 0 || [path isEqualToString:@"/"])
         return nil;
@@ -508,7 +508,7 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") {
         if ([Manager_ fileExistsAtPath:[path stringByAppendingPathComponent:@"Info.plist"]])
             bundle = [NSBundle bundleWithPath:path];
         if (bundle == nil)
-            bundle = [NSBundle wb$bundleWithFile:path];
+            bundle = [NSBundle _wb$bundleWithFile:path];
         if (Debug_)
             NSLog(@"WB:Debug:PathBundle(%@, %@)", path, bundle);
 
@@ -520,6 +520,12 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") {
     return bundle;
 }
 
++ (NSBundle *) wb$bundleWithFile:(NSString *)path {
+    if ([path hasPrefix:@"/Library/Themes"])
+        return nil;
+    return [self _wb$bundleWithFile:path];
+}
+
 @end
 // }}}
 // -[NSString wb$themedPath] {{{
@@ -530,9 +536,6 @@ static NSString *$pathForIcon$(SBApplication *self, NSString *suffix = @"") {
 @implementation NSString (WinterBoard)
 
 - (NSString *) wb$themedPath {
-    if ([self hasPrefix:@"/Library/Themes/"])
-        return self;
-
     if (Debug_)
         NSLog(@"WB:Debug:Bypass(\"%@\")", self);