summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MobileCydia.mm3
-rw-r--r--UICaboodle/BrowserView.h3
-rw-r--r--UICaboodle/BrowserView.mm24
3 files changed, 27 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index aae8dd5..5f6fb36 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -8894,8 +8894,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
if ([base isEqualToString:@"url"]) {
// This kind of URL can contain slashes in the argument, so we can't parse them below.
NSString *destination = [[url absoluteString] substringFromIndex:([scheme length] + [@"://" length] + [base length] + [@"/" length])];
- controller = [[[CYBrowserController alloc] init] autorelease];
- [(CYBrowserController *)controller loadURL:[NSURL URLWithString:destination]];
+ controller = [[[CYBrowserController alloc] initWithURL:[NSURL URLWithString:destination]] autorelease];
} else if ([components count] == 1) {
if ([base isEqualToString:@"manage"]) {
controller = [[[ManageController alloc] init] autorelease];
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h
index efc1e6c..79652f3 100644
--- a/UICaboodle/BrowserView.h
+++ b/UICaboodle/BrowserView.h
@@ -91,6 +91,8 @@
+ (void) _initialize;
+- (void) setURL:(NSURL *)url;
+
- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
- (void) loadURL:(NSURL *)url;
@@ -99,6 +101,7 @@
- (bool) isLoading;
- (id) init;
+- (id) initWithURL:(NSURL *)url;
- (id) initWithWidth:(float)width;
- (id) initWithWidth:(float)width ofClass:(Class)_class;
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index 2abc02e..c4e4b36 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -27,6 +27,7 @@ extern NSString * const kCAFilterNearest;
#include "substrate.h"
#define ForSaurik 0
+#define DefaultTimeout_ 120.0
template <typename Type_>
static inline void CYRelease(Type_ &value) {
@@ -463,11 +464,21 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
[super dealloc];
}
+- (void) setURL:(NSURL *)url {
+ _assert(request_ == nil);
+
+ request_ = [[NSURLRequest
+ requestWithURL:url
+ cachePolicy:NSURLRequestUseProtocolCachePolicy
+ timeoutInterval:DefaultTimeout_
+ ] retain];
+}
+
- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy {
[self loadRequest:[NSURLRequest
requestWithURL:url
cachePolicy:policy
- timeoutInterval:120.0
+ timeoutInterval:DefaultTimeout_
]];
}
@@ -507,6 +518,11 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
}
}
+- (void) reloadData {
+ [super reloadData];
+ [self reloadURL];
+}
+
- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function {
if (custom_ != nil)
[custom_ autorelease];
@@ -1035,6 +1051,12 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
return [self initWithWidth:0];
}
+- (id) initWithURL:(NSURL *)url {
+ if ((self = [self init]) != nil) {
+ [self setURL:url];
+ } return self;
+}
+
- (void) didDismissModalViewController {
if (closer_ != nil)
[self callFunction:closer_];