]> git.saurik.com Git - cydia.git/blobdiff - MobileCydia.mm
Centralize addCydiaHost: to Cydia delegate_.
[cydia.git] / MobileCydia.mm
index 694be20b72f2cf9a8580f7696bc020816eb11a4d..617562f6d68f8d63e4c99c474237ebe6ff7d6c64 100644 (file)
@@ -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 {
@@ -9146,7 +9147,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
 - (void) repairWithInvocation:(NSInvocation *)invocation {
     _trace();
-    [self invokeNewProgress:invocation forController:nil withTitle:UCLocalize("REPAIRING")];
+    [self invokeNewProgress:invocation forController:nil withTitle:@"REPAIRING"];
     _trace();
 }
 
@@ -9172,7 +9173,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
     fclose(file);
 
-    [self detachNewProgressSelector:@selector(update_) toTarget:self forController:nil title:UCLocalize("UPDATING_SOURCES")];
+    [self detachNewProgressSelector:@selector(update_) toTarget:self forController:nil title:@"UPDATING_SOURCES"];
 
     [self complete];
 }
@@ -9278,7 +9279,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 - (void) confirmWithNavigationController:(UINavigationController *)navigation {
     Queuing_ = false;
     ++locked_;
-    [self detachNewProgressSelector:@selector(perform) toTarget:database_ forController:navigation title:UCLocalize("RUNNING")];
+    [self detachNewProgressSelector:@selector(perform) toTarget:database_ forController:navigation title:@"RUNNING"];
     --locked_;
     [self complete];
 }
@@ -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_]);