From: Jay Freeman (saurik) Date: Sun, 20 Feb 2011 09:13:14 +0000 (-0800) Subject: Factor out -[ConfirmationController complete]. X-Git-Tag: v1.1.0%b1~278 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/ab2cfc1e0f4678f398698b0d9db90c69e1e71f3c?ds=inline Factor out -[ConfirmationController complete]. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 484d0ede..31d4c475 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4470,16 +4470,20 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [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"]) { - if (button == [alert cancelButtonIndex]) { + if (button == [alert cancelButtonIndex]) [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]; @@ -4717,11 +4721,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) confirmButtonClicked { if (essential_ != nil) [essential_ show]; - else { - if (substrate_) - Finish_ = 2; - [delegate_ confirmWithNavigationController:[self navigationController]]; - } + else + [self complete]; } #endif