summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-07 09:19:20 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-08 01:50:05 -0800
commite2add7b8216598e30a3fcfb99abda07736e3828e (patch)
tree7a7ba5d117903a03864a7c867ef346cf87fab0db /MobileCydia.mm
parent8252b666246879752a14fcf55e1debbb63da9d92 (diff)
Cache results of CydiaIcon.png requests.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index ae3fc4c..2760977 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -7669,7 +7669,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
if ([base length] != 0) {
NSURL *url([NSURL URLWithString:[base stringByAppendingString:@"CydiaIcon.png"]]);
- if (NSData *data = [NSData dataWithContentsOfURL:url])
+ if (NSData *data = [NSURLConnection
+ sendSynchronousRequest:[NSURLRequest
+ requestWithURL:url
+ //cachePolicy:NSURLRequestUseProtocolCachePolicy
+ //timeoutInterval:5
+ ]
+
+ returningResponse:NULL
+ error:NULL
+ ])
if (UIImage *image = [UIImage imageWithData:data])
[self performSelectorOnMainThread:@selector(_setImage:) withObject:image waitUntilDone:NO];
}