]> git.saurik.com Git - cydia.git/commitdiff
Integrate SDURLCache: disk cache FTW.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Dec 2010 04:43:02 +0000 (20:43 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Dec 2010 08:51:44 +0000 (00:51 -0800)
.gitmodules [new file with mode: 0644]
MobileCydia.mm
SDURLCache [new submodule]
makefile

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..06bf85c
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "SDURLCache"]
+       path = SDURLCache
+       url = git://github.com/rs/SDURLCache.git
index 55c8bd55ec6fe220b3e936324b7958d979edd47a..c6ba06d03fd39f241a654acbe03637368d318cc5 100644 (file)
@@ -121,6 +121,7 @@ extern "C" {
 #include <Cytore.hpp>
 
 #include "UICaboodle/BrowserView.h"
+#include "SDURLCache/SDURLCache.h"
 
 #include "substrate.h"
 /* }}} */
@@ -8744,6 +8745,12 @@ static _finline void _setHomePage(Cydia *self) {
 
 - (void) applicationDidFinishLaunching:(id)unused {
 _trace();
+    [NSURLCache setSharedURLCache:[[[SDURLCache alloc]
+        initWithMemoryCapacity:524288
+        diskCapacity:10485760
+        diskPath:[NSString stringWithFormat:@"%@/Library/Caches/com.saurik.Cydia/SDURLCache", @"/var/root"]
+    ] autorelease]];
+
     [CYBrowserController _initialize];
 
     [NSURLProtocol registerClass:[CydiaURLProtocol class]];
diff --git a/SDURLCache b/SDURLCache
new file mode 160000 (submodule)
index 0000000..9f22f02
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 9f22f02b13b589f9a5179d9b1251311ac20e2e6d
index 89c43b270a2968bb670bcbce6be4d454ca187dab..168a74f03a5086b590df52afa45c8fb3f3bfe52b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -56,8 +56,8 @@ clean:
 %.o: %.c
        $(cycc) -c -o $@ -x c $<
 
-MobileCydia: MobileCydia.mm UICaboodle/*.h UICaboodle/*.mm iPhonePrivate.h lookup3.o Cytore.hpp
-       $(cycc) $(filter %.mm,$^) $(filter %.o,$^) $(flags) $(link) $(uikit)
+MobileCydia: MobileCydia.mm UICaboodle/*.h UICaboodle/*.mm SDURLCache/SDURLCache.h SDURLCache/SDURLCache.m iPhonePrivate.h lookup3.o Cytore.hpp
+       $(cycc) $(filter %.mm,$^) $(filter %.o,$^) $(foreach m,$(filter %.m,$^),-x objective-c++ $(m)) $(flags) $(link) $(uikit)
        ldid -Slaunch.xml $@ || { rm -f $@ && false; }
 
 CydiaAppliance: CydiaAppliance.mm