diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-23 18:48:18 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:13 -0800 |
commit | c138614de2b37cfd7bdf12a9b7998ae6b6108230 (patch) | |
tree | 89de8ce2c2577efff059e98a31c99bf67c56ab3f | |
parent | 5bd9467c2b5d1b32ce0f7527127cee9c280ad5df (diff) |
Use userInterfaceIdiom instead of isWildcat for /ui/ URL.
-rw-r--r-- | MobileCydia.mm | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 233d2ef..86db911 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -1066,6 +1066,7 @@ static time_t now_; bool IsWildcat_; static CGFloat ScreenScale_; +static NSString *Idiom_; /* }}} */ /* Display Helpers {{{ */ @@ -4052,17 +4053,7 @@ static NSString *Warning_; } - (NSString *) idiom { - UIDevice *device([UIDevice currentDevice]); - if (![device respondsToSelector:@selector(userInterfaceIdiom)]) - return @"iphone"; - - UIUserInterfaceIdiom idiom([device userInterfaceIdiom]); - if (idiom == UIUserInterfaceIdiomPhone) - return @"iphone"; - else if (idiom == UIUserInterfaceIdiomPad) - return @"ipad"; - else - return @"unknown"; + return (id) Idiom_ ?: [NSNull null]; } - (NSString *) plmn { @@ -9870,7 +9861,20 @@ int main(int argc, char *argv[]) { _pooled else ScreenScale_ = 1; - UI_ = CydiaURL([NSString stringWithFormat:@"ui/ios%@", (IsWildcat_ ? @"~ipad" : @"~iphone")]); + UIDevice *device([UIDevice currentDevice]); + if (![device respondsToSelector:@selector(userInterfaceIdiom)]) + Idiom_ = @"iphone"; + else { + UIUserInterfaceIdiom idiom([device userInterfaceIdiom]); + if (idiom == UIUserInterfaceIdiomPhone) + Idiom_ = @"iphone"; + else if (idiom == UIUserInterfaceIdiomPad) + Idiom_ = @"ipad"; + else + NSLog(@"unknown UIUserInterfaceIdiom!"); + } + + UI_ = CydiaURL([NSString stringWithFormat:@"ui/ios~%@", Idiom_]); PackageName = reinterpret_cast<CYString &(*)(Package *, SEL)>(method_getImplementation(class_getInstanceMethod([Package class], @selector(cyname)))); |