]> git.saurik.com Git - cydia.git/commitdiff
Reload the appcache if suspended over ten minutes.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Oct 2014 18:23:11 +0000 (11:23 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Oct 2014 18:23:11 +0000 (11:23 -0700)
CyteKit/WebViewController.h
MobileCydia.mm

index a159f37e9b33602758dbe01222284a82f7a67ef3..96186c1697f8b09a22d75efcdbe8bb4fdbb2f5a5 100644 (file)
 - (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;
index 823d9bd11ac7787440d12cd3defe63f6ecb5f784..4e6273432bd1541ec578de1006fc3ae9006ed4e8 100644 (file)
@@ -8930,6 +8930,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
     _H<UIWindow> window_;
     _H<CydiaTabBarController> tabbar_;
     _H<CyteTabBarController> emulated_;
+    _H<AppCacheController> appcache_;
 
     _H<NSMutableArray> essential_;
     _H<NSMutableArray> 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];