]> git.saurik.com Git - winterboard.git/blobdiff - Settings.mm
Here we go again: this time with SBIcon setAlpha.
[winterboard.git] / Settings.mm
index 160073d22d2fc1d377698803589739254c5b9795..619df9bae7cb45a9ef17842c8534f185d9415b22 100644 (file)
@@ -572,8 +572,28 @@ void AddThemes(NSMutableArray *themesOnDisk, NSString *folder) {
 }
 
 - (id) specifiers {
-    if (!_specifiers)
-        _specifiers = [[self loadSpecifiersFromPlistName:@"WinterBoard" target:self] retain];
+    if (!_specifiers) {
+        NSMutableArray *specifiers([NSMutableArray array]);
+        for (PSSpecifier *specifier in [self loadSpecifiersFromPlistName:@"WinterBoard" target:self]) {
+            if (NSArray *version = [specifier propertyForKey:@"wb$filter"]) {
+                size_t count([version count]);
+                if (count == 0 || count > 2)
+                    continue;
+
+                double lower([[version objectAtIndex:0] doubleValue]);
+                if (kCFCoreFoundationVersionNumber < lower)
+                    continue;
+
+                if (count != 1) {
+                    double upper([[version objectAtIndex:1] doubleValue]);
+                    if (upper <= kCFCoreFoundationVersionNumber)
+                        continue;
+                }
+            }
+            [specifiers addObject:specifier];
+        }
+        _specifiers = [specifiers retain];
+    }
     return _specifiers;
 }