]> git.saurik.com Git - cydia.git/commitdiff
Hide custom function_ as an implementation detail.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 15 Feb 2017 09:58:44 +0000 (01:58 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 15 Feb 2017 09:58:44 +0000 (01:58 -0800)
CyteKit/WebViewController.h
CyteKit/WebViewController.mm
MobileCydia.mm

index c8630d90e1e2ba5d993740edcf1ef0106fe49ad0..20fe47523d925300d100c1445ffc9a2c669dad46 100644 (file)
 - (void) customButtonClicked;
 
 - (void) applyRightButton;
-- (UIBarButtonItem *) customButton;
 - (UIBarButtonItem *) rightButton;
 
 - (void) applyLeftButton;
index 18b40d945ca68943aafe83911d97dc6fe954c160..4f11b5d01c2b6050b7e8a217f65bb7214974414b 100644 (file)
@@ -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<NSString *>(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;
index 0485f54fd1a56b45f851468581d811ee8f2e6393..a1c06d76ed7345b02e75c12295943f0aa62738f0 100644 (file)
@@ -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.
 }