summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-28 07:12:38 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:27 -0800
commitf36e5eacd0fe669ad705b101d984228c1a1d55d0 (patch)
tree3a0ee2d71150a95dad2c9afad01fe5d30b4dd079
parent15f0d6136bbba5eb090b2614f08516083484093b (diff)
Clean up UIProgressHUD code.
-rw-r--r--MobileCydia.mm14
1 files changed, 9 insertions, 5 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 00e61af..6c6719a 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -9536,21 +9536,25 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
[hud setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
[window_ setUserInteractionEnabled:NO];
- [hud show:YES];
- UIViewController *target = tabbar_;
- while ([target modalViewController] != nil) target = [target modalViewController];
- [[target view] addSubview:hud];
+ UIViewController *target(tabbar_);
+ if (UIViewController *modal = [target modalViewController])
+ target = modal;
+
+ UIView *view([target view]);
+ [view addSubview:hud];
+
+ [hud show:YES];
++locked_;
return hud;
}
- (void) removeProgressHUD:(UIProgressHUD *)hud {
+ --locked_;
[hud show:NO];
[hud removeFromSuperview];
[window_ setUserInteractionEnabled:YES];
- --locked_;
}
- (CYViewController *) pageForPackage:(NSString *)name {