diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-20 01:27:05 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-20 01:27:05 -0800 |
commit | be860cc8aff097d7ab995371463543e89493c79f (patch) | |
tree | 1d5d3fa6637fdb98c802d3deb5eeb9af1aea59c7 /MobileCydia.mm | |
parent | ab2cfc1e0f4678f398698b0d9db90c69e1e71f3c (diff) |
Don't restart SpringBoard if download failed.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 31d4c47..dcbd188 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -987,6 +987,7 @@ static const int PulseInterval_ = 50000; static const NSString *UI_; static int Finish_; +static bool RestartSubstrate_; static NSArray *Finishes_; #define SpringBoard_ "/System/Library/LaunchDaemons/com.apple.SpringBoard.plist" @@ -3683,6 +3684,9 @@ static NSString *Warning_; } - (void) perform { + bool substrate(RestartSubstrate_); + RestartSubstrate_ = false; + NSString *title(UCLocalize("PERFORM_SELECTIONS")); NSMutableArray *before = [NSMutableArray arrayWithCapacity:16]; { @@ -3728,6 +3732,9 @@ static NSString *Warning_; return; } + if (substrate) + RestartSubstrate_ = true; + _system->UnLock(); pkgPackageManager::OrderResult result = manager_->DoInstall(statusfd_); @@ -4472,7 +4479,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) complete { if (substrate_) - Finish_ = 2; + RestartSubstrate_ = true; [delegate_ confirmWithNavigationController:[self navigationController]]; } @@ -4989,6 +4996,13 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } + if (Finish_ < 2) { + if (RestartSubstrate_) + Finish_ = 2; + } + + RestartSubstrate_ = false; + switch (Finish_) { case 0: [close_ setTitle:UCLocalize("RETURN_TO_CYDIA")]; break; /* XXX: Maybe UCLocalize("DONE")? */ case 1: [close_ setTitle:UCLocalize("CLOSE_CYDIA")]; break; |