From: Jay Freeman (saurik) Date: Thu, 10 Mar 2011 06:22:03 +0000 (-0800) Subject: Save the state during abnormal terminations. X-Git-Tag: v1.1.0%b4~14 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/9dd3045d98e3d2905f4b656c44b933a06fbe7736?ds=sidebyside;hp=37fa9338c8b79e1212a8709b688fe13686837db5 Save the state during abnormal terminations. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 096c4ab5..fd5c1c42 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -871,6 +871,7 @@ static NSString *CYHex(NSData *data, bool reverse = false) { @class CYPackageController; @protocol CydiaDelegate +- (void) saveState; - (void) retainNetworkActivityIndicator; - (void) releaseNetworkActivityIndicator; - (void) clearPackage:(Package *)package; @@ -5072,6 +5073,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) close { UpdateExternalStatus(0); + if (Finish_ > 1) + [delegate_ saveState]; + switch (Finish_) { case 0: break; @@ -9478,15 +9482,19 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [super applicationWillResignActive:application]; } -- (void) applicationWillTerminate:(UIApplication *)application { - Changed_ = true; +- (void) saveState { [Metadata_ setObject:[tabbar_ navigationURLCollection] forKey:@"InterfaceState"]; [Metadata_ setObject:[NSDate date] forKey:@"LastClosed"]; [Metadata_ setObject:[NSNumber numberWithInt:[tabbar_ selectedIndex]] forKey:@"InterfaceIndex"]; + Changed_ = true; [self _saveConfig]; } +- (void) applicationWillTerminate:(UIApplication *)application { + [self saveState]; +} + - (void) setConfigurationData:(NSString *)data { static Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");