]> git.saurik.com Git - cydia.git/commitdiff
Don't restart SpringBoard if download failed.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 20 Feb 2011 09:27:05 +0000 (01:27 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 20 Feb 2011 09:27:05 +0000 (01:27 -0800)
MobileCydia.mm

index 31d4c4758f07b1a5f11bf02f5d4d62e9a788c035..dcbd1881cba0a738f68b22d2d35e44cb60a974b0 100644 (file)
@@ -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;