From: Jay Freeman (saurik) Date: Wed, 29 Oct 2014 18:23:11 +0000 (-0700) Subject: Reload the appcache if suspended over ten minutes. X-Git-Tag: v1.1.14~16 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/fedd38feb88ac93531aad19ab217e7d61b17f7b9 Reload the appcache if suspended over ten minutes. --- diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h index a159f37e..96186c16 100644 --- a/CyteKit/WebViewController.h +++ b/CyteKit/WebViewController.h @@ -103,6 +103,7 @@ - (id) initWithWidth:(float)width ofClass:(Class)_class; - (void) callFunction:(WebScriptObject *)function; +- (void) reloadURLWithCache:(BOOL)cache; - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame; - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source; diff --git a/MobileCydia.mm b/MobileCydia.mm index 823d9bd1..4e627343 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8930,6 +8930,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi _H window_; _H tabbar_; _H emulated_; + _H appcache_; _H essential_; _H broken_; @@ -9738,6 +9739,7 @@ _end return; [tabbar_ beginUpdate]; + [appcache_ reloadURLWithCache:YES]; } - (void) setConfigurationData:(NSString *)data { @@ -9884,7 +9886,8 @@ _trace(); broken_ = [NSMutableArray arrayWithCapacity:4]; // XXX: I really need this thing... like, seriously... I'm sorry - [[[AppCacheController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/appcache/", UI_]]] reloadData]; + appcache_ = [[[AppCacheController alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/appcache/", UI_]]] autorelease]; + [appcache_ reloadData]; window_ = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; [window_ orderFront:self];