From 765aedc819ed8882f60b50ae8f88b341b7a2fdda Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 20 Feb 2011 01:13:14 -0800 Subject: [PATCH] Factor out -[ConfirmationController complete]. --- MobileCydia.mm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) 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 -- 2.45.2