]> git.saurik.com Git - cydia.git/commitdiff
Cache results of CydiaIcon.png requests.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 17:19:20 +0000 (09:19 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Mar 2011 09:50:05 +0000 (01:50 -0800)
MobileCydia.mm

index ae3fc4cba608e238a48769cf53ff8483733073d5..2760977253e0654ce2e40c396bcb942f45baf5b8 100644 (file)
@@ -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];
         }