]> git.saurik.com Git - cydia.git/blobdiff - Cydia.mm
Started the work to port Cydia back to a 2.0-era toolchain.
[cydia.git] / Cydia.mm
index 07d44a75a9e9a53e7cb201f465839fdcff2b8264..17f0c3f2ecfd331616a0dbdd3c636cddab0f092d 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -1634,11 +1634,11 @@ typedef std::map< unsigned long, _H<Source> > SourceMap;
 }
 
 - (NSString *) depictionForPackage:(NSString *)package {
-    return depiction_.empty() ? nil : [depiction_ stringByReplacingOccurrencesOfString:@"*" withString:package];
+    return depiction_.empty() ? nil : [static_cast<id>(depiction_) stringByReplacingOccurrencesOfString:@"*" withString:package];
 }
 
 - (NSString *) supportForPackage:(NSString *)package {
-    return support_.empty() ? nil : [support_ stringByReplacingOccurrencesOfString:@"*" withString:package];
+    return support_.empty() ? nil : [static_cast<id>(support_) stringByReplacingOccurrencesOfString:@"*" withString:package];
 }
 
 - (NSDictionary *) record {
@@ -2180,7 +2180,7 @@ struct PackageNameOrdering :
         _end
 
         bool changed(false);
-        NSString *key([id_ lowercaseString]);
+        NSString *key([static_cast<id>(id_) lowercaseString]);
 
         _profile(Package$initWithVersion$Metadata)
             metadata_ = [Packages_ objectForKey:key];
@@ -2486,9 +2486,9 @@ struct PackageNameOrdering :
 
     UIImage *icon(nil);
     if (!icon_.empty())
-        if ([icon_ hasPrefix:@"file:///"])
+        if ([static_cast<id>(icon_) hasPrefix:@"file:///"])
             // XXX: correct escaping
-            icon = [UIImage imageAtPath:[icon_ substringFromIndex:7]];
+            icon = [UIImage imageAtPath:[static_cast<id>(icon_) substringFromIndex:7]];
     if (icon == nil) if (section != nil)
         icon = [UIImage imageAtPath:[NSString stringWithFormat:@"%@/Sections/%@.png", App_, section]];
     if (icon == nil) if (source_ != nil) if (NSString *dicon = [source_ defaultIcon])
@@ -7766,13 +7766,21 @@ freeing the view controllers on tab change */
     updatedelegate_ = delegate;
 }
 
+- (CGFloat) statusBarHeight {
+    if (UIInterfaceOrientationIsPortrait([self interfaceOrientation])) {
+        return [[UIApplication sharedApplication] statusBarFrame].size.height;
+    } else {
+        return [[UIApplication sharedApplication] statusBarFrame].size.width;
+    }
+}
+
 - (void) dropBar:(BOOL)animated {
     if (dropped_) return;
     dropped_ = true;
 
     [[self view] addSubview:refreshbar_];
 
-    CGFloat sboffset = [[UIApplication sharedApplication] statusBarFrame].size.height;
+    CGFloat sboffset = [self statusBarHeight];
 
     CGRect barframe = [refreshbar_ frame];   
     barframe.origin.y = sboffset;
@@ -7799,7 +7807,7 @@ freeing the view controllers on tab change */
 
     [refreshbar_ removeFromSuperview];
 
-    CGFloat sboffset = [[UIApplication sharedApplication] statusBarFrame].size.height;
+    CGFloat sboffset = [self statusBarHeight]; 
 
     if (animated) [UIView beginAnimations:nil context:NULL];
     CGRect barframe = [refreshbar_ frame];