summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2012-01-20 00:04:40 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2012-01-20 00:26:30 -0800
commit2ef6faadc0910c127a209d38c53e04c401899ee6 (patch)
tree292575280c7b23061a37dc65142f095f005ef447
parent8d3505c59edf839ccf7b79687181299e2011c663 (diff)
Factor locked_ variable *crementing to separate methods.
-rw-r--r--MobileCydia.mm20
1 files changed, 14 insertions, 6 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index ba7b9ab..f789b46 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -9340,6 +9340,14 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
@implementation Cydia
+- (void) lockSuspend {
+ ++locked_;
+}
+
+- (void) unlockSuspend {
+ --locked_;
+}
+
- (void) beginUpdate {
[tabbar_ beginUpdate];
}
@@ -9709,9 +9717,9 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
- (void) confirmWithNavigationController:(UINavigationController *)navigation {
Queuing_ = false;
- ++locked_;
+ [self lockSuspend];
[self detachNewProgressSelector:@selector(perform_) toTarget:self forController:navigation title:@"RUNNING"];
- --locked_;
+ [self unlockSuspend];
}
- (void) showSettings {
@@ -9876,12 +9884,12 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
[hud showInView:[target view]];
- ++locked_;
+ [self lockSuspend];
return hud;
}
- (void) removeProgressHUD:(UIProgressHUD *)hud {
- --locked_;
+ [self unlockSuspend];
[hud hide];
[hud removeFromSuperview];
[window_ setUserInteractionEnabled:YES];
@@ -10067,7 +10075,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
}
- (void) addStashController {
- ++locked_;
+ [self lockSuspend];
stash_ = [[[StashController alloc] init] autorelease];
[window_ addSubview:[stash_ view]];
}
@@ -10075,7 +10083,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
- (void) removeStashController {
[[stash_ view] removeFromSuperview];
stash_ = nil;
- --locked_;
+ [self unlockSuspend];
}
- (void) stash {