From: Jay Freeman (saurik) Date: Wed, 15 Feb 2017 09:58:44 +0000 (-0800) Subject: Hide custom function_ as an implementation detail. X-Git-Tag: v1.1.29~9 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/f274bb0c14b13e0e7bbf65fc5a07f40fcaa482cc Hide custom function_ as an implementation detail. --- diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h index c8630d90..20fe4752 100644 --- a/CyteKit/WebViewController.h +++ b/CyteKit/WebViewController.h @@ -121,7 +121,6 @@ - (void) customButtonClicked; - (void) applyRightButton; -- (UIBarButtonItem *) customButton; - (UIBarButtonItem *) rightButton; - (void) applyLeftButton; diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 18b40d94..4f11b5d0 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -793,9 +793,9 @@ float CYScrollViewDecelerationRateNormal; - (UIBarButtonItem *) customButton { if (custom_ == nil) - return nil; + return [self rightButton]; else if ((/*clang:*/id) custom_ == [NSNull null]) - return (UIBarButtonItem *) [NSNull null]; + return nil; return [[[UIBarButtonItem alloc] initWithTitle:static_cast(custom_.operator NSObject *()) @@ -848,14 +848,7 @@ float CYScrollViewDecelerationRateNormal; [self applyLoadingTitle]; } else { [indicator_ stopAnimating]; - - UIBarButtonItem *button([self customButton]); - if (button == nil) - button = [self rightButton]; - else if (button == (UIBarButtonItem *) [NSNull null]) - button = nil; - - [[self navigationItem] setRightBarButtonItem:button animated:YES]; + [[self navigationItem] setRightBarButtonItem:[self customButton] animated:YES]; } } @@ -920,7 +913,7 @@ float CYScrollViewDecelerationRateNormal; initWithTitle:(kCFCoreFoundationVersionNumber >= 800 ? @" " : @" ") style:UIBarButtonItemStylePlain target:self - action:@selector(reloadButtonClicked) + action:@selector(customButtonClicked) ] autorelease]; UIActivityIndicatorViewStyle style; diff --git a/MobileCydia.mm b/MobileCydia.mm index 0485f54f..a1c06d76 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -6398,6 +6398,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { #if !AlwaysReload - (void) _customButtonClicked { + if (commercial_ && [package_ uninstalled]) + return [self reloadURLWithCache:NO]; + size_t count(buttons_.size()); if (count == 0) return; @@ -6425,12 +6428,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } -- (void) reloadButtonClicked { - if (commercial_ && function_ == nil && [package_ uninstalled]) - return; - [self customButtonClicked]; -} - - (void) applyLoadingTitle { // Don't show "Loading" as the title. Ever. }