]> git.saurik.com Git - cydia.git/commitdiff
Factor out -[ConfirmationController complete].
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 20 Feb 2011 09:13:14 +0000 (01:13 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 20 Feb 2011 09:13:14 +0000 (01:13 -0800)
MobileCydia.mm

index 484d0ede5ec147f759dea4d3a7f137a3ded95556..31d4c4758f07b1a5f11bf02f5d4d62e9a788c035 100644 (file)
@@ -4470,16 +4470,20 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
     [super dealloc];
 }
 
     [super dealloc];
 }
 
+- (void) complete {
+    if (substrate_)
+        Finish_ = 2;
+    [delegate_ confirmWithNavigationController:[self navigationController]];
+}
+
 - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button {
     NSString *context([alert context]);
 
     if ([context isEqualToString:@"remove"]) {
 - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button {
     NSString *context([alert context]);
 
     if ([context isEqualToString:@"remove"]) {
-        if (button == [alert cancelButtonIndex]) {
+        if (button == [alert cancelButtonIndex])
             [self dismissModalViewControllerAnimated:YES];
             [self dismissModalViewControllerAnimated:YES];
-        } else if (button == [alert firstOtherButtonIndex]) {
-            if (substrate_)
-                Finish_ = 2;
-            [delegate_ confirmWithNavigationController:[self navigationController]];
+        else if (button == [alert firstOtherButtonIndex]) {
+            [self complete];
         }
 
         [alert dismissWithClickedButtonIndex:-1 animated:YES];
         }
 
         [alert dismissWithClickedButtonIndex:-1 animated:YES];
@@ -4717,11 +4721,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 - (void) confirmButtonClicked {
     if (essential_ != nil)
         [essential_ show];
 - (void) confirmButtonClicked {
     if (essential_ != nil)
         [essential_ show];
-    else {
-        if (substrate_)
-            Finish_ = 2;
-        [delegate_ confirmWithNavigationController:[self navigationController]];
-    }
+    else
+        [self complete];
 }
 #endif
 
 }
 #endif