summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-25 04:21:23 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:18 -0800
commit3171f7feeffaa5f27d852bc6dcb84705f57cf882 (patch)
treef09e6aed2befd6725a7381b22d1efb1c05cab448
parent8d5bc2adf44fa65f9990999b8c3f97507ed41637 (diff)
Centralize addCydiaHost: to Cydia delegate_.
-rw-r--r--MobileCydia.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 38364ce..617562f 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -1067,7 +1067,7 @@ bool IsWildcat_;
static CGFloat ScreenScale_;
static NSString *Idiom_;
-static NSSet *CydiaHosts_;
+static NSMutableSet *CydiaHosts_;
/* }}} */
/* Display Helpers {{{ */
@@ -1170,6 +1170,7 @@ bool isSectionVisible(NSString *section) {
- (CYViewController *) pageForPackage:(NSString *)name;
- (void) showActionSheet:(UIActionSheet *)sheet fromItem:(UIBarButtonItem *)item;
- (void) reloadDataWithInvocation:(NSInvocation *)invocation;
+- (void) addCydiaHost:(NSString *)host;
@end
/* }}} */
@@ -4232,7 +4233,7 @@ static NSString *Warning_;
}
- (void) addCydiaHost:(NSString *)host {
- [CydiaHosts_ performSelectorOnMainThread:@selector(addObject:) withObject:host waitUntilDone:NO];
+ [delegate_ performSelectorOnMainThread:@selector(addCydiaHost:) withObject:host waitUntilDone:NO];
}
- (void) addTrivialSource:(NSString *)href {
@@ -9663,11 +9664,17 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
[tabbar_ setUpdateDelegate:self];
}
+- (void) addCydiaHost:(NSString *)host {
+ [CydiaHosts_ addObject:host];
+}
+
- (void) applicationDidFinishLaunching:(id)unused {
_trace();
if ([self respondsToSelector:@selector(setApplicationSupportsShakeToEdit:)])
[self setApplicationSupportsShakeToEdit:NO];
+ [self addCydiaHost:[[NSURL URLWithString:CydiaURL(@"")] host]];
+
[NSURLCache setSharedURLCache:[[[SDURLCache alloc]
initWithMemoryCapacity:524288
diskCapacity:10485760
@@ -9928,7 +9935,7 @@ int main(int argc, char *argv[]) { _pooled
NSLog(@"unknown UIUserInterfaceIdiom!");
}
- CydiaHosts_ = [NSMutableSet setWithObject:[[NSURL URLWithString:CydiaURL(@"")] host]];
+ CydiaHosts_ = [NSMutableSet setWithCapacity:2];
UI_ = CydiaURL([NSString stringWithFormat:@"ui/ios~%@", Idiom_]);