summaryrefslogtreecommitdiff
path: root/UICaboodle
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-19 03:33:22 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-02-19 03:33:22 -0800
commitb13b8664e70405f065a37d67fb4eb7c39a6a438b (patch)
treec512c21bd2d0fde8c12ead7b90a902a1746a91e5 /UICaboodle
parentd71f3a07db779a610c9f3d6b50cfe6c022b7f618 (diff)
Super-charge the Reload button to actually reload.
Diffstat (limited to 'UICaboodle')
-rw-r--r--UICaboodle/BrowserView.h4
-rw-r--r--UICaboodle/BrowserView.mm16
2 files changed, 16 insertions, 4 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h
index 0b52fb9..4e9be45 100644
--- a/UICaboodle/BrowserView.h
+++ b/UICaboodle/BrowserView.h
@@ -98,9 +98,11 @@
- (void) loadURL:(NSURL *)url;
- (void) loadRequest:(NSURLRequest *)request;
-- (void) reloadURL;
- (bool) isLoading;
+- (void) reloadURLWithCache:(BOOL)cache;
+- (void) reloadURL;
+
- (id) init;
- (id) initWithURL:(NSURL *)url;
- (id) initWithWidth:(float)width;
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index fa71a74..d549640 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -541,10 +541,16 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
[webview_ loadRequest:request];
}
-- (void) reloadURL {
+- (void) reloadURLWithCache:(BOOL)cache {
if (request_ == nil)
return;
+ NSMutableURLRequest *request([request_ mutableCopy]);
+ [request setCachePolicy:(cache ? NSURLRequestUseProtocolCachePolicy : NSURLRequestReloadIgnoringLocalCacheData)];
+
+ [request_ autorelease];
+ request_ = [request retain];
+
if ([request_ HTTPBody] == nil && [request_ HTTPBodyStream] == nil)
[self loadRequest:request_];
else {
@@ -563,9 +569,13 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
}
}
+- (void) reloadURL {
+ [self reloadURLWithCache:YES];
+}
+
- (void) reloadData {
[super reloadData];
- [self reloadURL];
+ [self reloadURLWithCache:YES];
}
- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function {
@@ -1157,7 +1167,7 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
}
- (void) reloadButtonClicked {
- [self reloadURL];
+ [self reloadURLWithCache:YES];
}
- (void) _customButtonClicked {