]> git.saurik.com Git - cydia.git/commitdiff
Drastic performance and stability increases.
authorJay Freeman (saurik) <saurik@saurk.com>
Mon, 22 Jun 2009 11:35:37 +0000 (11:35 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 07:13:57 +0000 (07:13 +0000)
Cydia.app/Sources/cydia.ifoneguide.nl.png [deleted file]
Cydia.mm
Library/firmware.sh
UICaboodle/BrowserView.h
UICaboodle/BrowserView.mm
control

diff --git a/Cydia.app/Sources/cydia.ifoneguide.nl.png b/Cydia.app/Sources/cydia.ifoneguide.nl.png
deleted file mode 100644 (file)
index 7027801..0000000
Binary files a/Cydia.app/Sources/cydia.ifoneguide.nl.png and /dev/null differ
index bac29757349b886aa0f5d3b21c03bd191f9a9d8d..71b9dcdc818934d4fa2c8979ba93b58a031a819e 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -417,6 +417,7 @@ static const CFStringCompareFlags LaxCompareFlags_ = kCFCompareCaseInsensitive |
 #define ShowInternals (0 && !ForRelease)
 #define IgnoreInstall (0 && !ForRelease)
 #define RecycleWebViews 0
+#define RecyclePackageViews 0
 #define AlwaysReload (1 && !ForRelease)
 
 #if !TraceLogging
@@ -2457,9 +2458,12 @@ struct PackageNameOrdering :
 
 - (Address *) author {
     if (author$_ == nil) {
+_trace();
         if (author_.empty())
             return nil;
+_trace();
         author$_ = [[Address addressWithString:author_] retain];
+_trace();
     } return author$_;
 }
 
@@ -7489,7 +7493,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
     ManageView *manage_;
     SearchView *search_;
 
+#if RecyclePackageViews
     NSMutableArray *details_;
+#endif
 }
 
 @end
@@ -7871,8 +7877,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 - (void) setPackageView:(PackageView *)view {
     WebThreadLock();
     [view setPackage:nil];
+#if RecyclePackageViews
     if ([details_ count] < 3)
         [details_ addObject:view];
+#endif
     WebThreadUnlock();
 }
 
@@ -7881,6 +7889,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 }
 
 - (PackageView *) packageView {
+#if RecyclePackageViews
     PackageView *view;
     size_t count([details_ count]);
 
@@ -7896,6 +7905,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
     }
 
     return view;
+#else
+    return [self _packageView];
+#endif
 }
 
 - (void) finish {
@@ -8030,9 +8042,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
         withClass:[ManageView class]
     ] retain];
 
+#if RecyclePackageViews
     details_ = [[NSMutableArray alloc] initWithCapacity:4];
     [details_ addObject:[self _packageView]];
     [details_ addObject:[self _packageView]];
+#endif
 
     PrintTimes();
 
@@ -8278,6 +8292,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 }
 
 - (void) applicationDidFinishLaunching:(id)unused {
+    [BrowserView _initialize];
+
     _trace();
     Font12_ = [[UIFont systemFontOfSize:12] retain];
     Font12Bold_ = [[UIFont boldSystemFontOfSize:12] retain];
@@ -8587,7 +8603,8 @@ int main(int argc, char *argv[]) { _pooled
     /*if (substrate && access("/Library/MobileSubstrate/MobileSubstrate.dylib", F_OK) == 0)
         dlopen("/Library/MobileSubstrate/MobileSubstrate.dylib", RTLD_LAZY | RTLD_GLOBAL);*/
 
-    if (access("/User", F_OK) != 0) {
+    if (access("/User", F_OK) != 0 || access("/tmp/.cydia.fw", F_OK) != 0) {
+        unlink("/tmp/.cydia.fw");
         _trace();
         system("/usr/libexec/cydia/firmware.sh");
         _trace();
index 0ad61754e2316b57f8185605c8e6739d747a417d..e91eef344f3e5350abd654c7368fed6bdb7f7e4d 100755 (executable)
@@ -3,19 +3,40 @@ set -e
 
 version=$(sw_vers -productVersion)
 
-cat /var/lib/dpkg/status | while IFS= read -r line; do
+cat /var/lib/dpkg/status | {
+
+while IFS= read -r line; do
+    #echo "#${firmware+@}/${blank+@} ${line}" 1>&2
+
+    if [[ ${line} == '' && "${blank+@}" ]]; then
+        continue
+    else
+        unset blank
+    fi
+
     if [[ ${line} == 'Package: firmware' ]]; then
         firmware=
     elif [[ ${line} == '' ]]; then
-        unset firmware
-    elif [[ "${firmware+@}" ]]; then
+        blank=
+    fi
+
+    if [[ "${firmware+@}" ]]; then
+        if [[ "${blank+@}" ]]; then
+            unset firmware
+        fi
         continue
     fi
 
+    #echo "${firmware+@}/${blank+@} ${line}" 1>&2
     echo "${line}"
-done >/var/lib/dpkg/status_
+done
 
-cat >>/var/lib/dpkg/status_ <<EOF
+#echo "#${firmware+@}/${blank+@} EOF" 1>&2
+if ! [[ "${blank+@}" || "${firmware+@}" ]]; then
+    echo
+fi
+
+cat <<EOF
 Package: firmware
 Essential: yes
 Status: install ok installed
@@ -30,6 +51,8 @@ Name: iPhone Firmware
 
 EOF
 
+} >/var/lib/dpkg/status_
+
 mv -f /var/lib/dpkg/status{_,}
 
 echo "/." >/var/lib/dpkg/info/firmware.list
index f1a9dbcb56101e97d0226e65e2b9c01dbc25d5a6..bd956b83874a35ce27660e5341f1d2c5cf38f002 100644 (file)
@@ -80,6 +80,8 @@
     Class class_;
 }
 
++ (void) _initialize;
+
 - (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button;
 
 - (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
index b99c2d2bb4f4d76309814f7bd69db1e7c63f7105..e08c291fa7726b37ffb3dd43cad4d17b8466a686 100644 (file)
@@ -6,6 +6,7 @@
 extern NSString * const kCAFilterNearest;
 
 #include <WebCore/WebCoreThread.h>
+#include <WebKit/WebPreferences-WebPrivate.h>
 
 #include "substrate.h"
 
@@ -209,12 +210,28 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize(
 /* }}} */
 #endif
 
+#define ShowInternals 0
+#define LogBrowser 0
+
+#define lprintf(args...) fprintf(stderr, args)
+
 @implementation BrowserView
 
 #if ShowInternals
-#include "Internals.h"
+#include "UICaboodle/UCInternal.h"
 #endif
 
++ (void) _initialize {
+    NSLog(@"INITIALIZING");
+    [WebView enableWebThread];
+
+    WebPreferences *preferences([WebPreferences standardPreferences]);
+    [preferences setCacheModel:WebCacheModelDocumentBrowser];
+    [preferences setOfflineWebApplicationCacheEnabled:YES];
+
+    [WebPreferences _setInitialDefaultTextEncodingToSystemEncoding];
+}
+
 - (void) dealloc {
 #if LogBrowser
     NSLog(@"[BrowserView dealloc]");
@@ -232,9 +249,8 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize(
     [webview setScriptDebugDelegate:nil];
     [webview setPolicyDelegate:nil];
 
-    [webview setDownloadDelegate:nil];
-
     /* XXX: these are set by UIWebDocumentView
+    [webview setDownloadDelegate:nil];
     [webview _setFormDelegate:nil];
     [webview _setUIKitDelegate:nil];
     [webview setEditingDelegate:nil];*/
@@ -425,6 +441,13 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize(
         return false;
 }
 
+- (void) formAssistant:(id)sender didBeginEditingFormNode:(id)node {
+}
+
+- (void) formAssistant:(id)sender didEndEditingFormNode:(id)node {
+    [self fixScroller];
+}
+
 - (void) webViewShow:(WebView *)sender {
     /* XXX: this is where I cry myself to sleep */
 }
@@ -1214,17 +1237,25 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize(
 
             [webview_ setTileSize:CGSizeMake(webrect.size.width, 500)];
 
+            if ([webview_ respondsToSelector:@selector(enableReachability)])
+                [webview_ enableReachability];
+
             [webview_ setAllowsMessaging:YES];
 
+            if ([webview_ respondsToSelector:@selector(useSelectionAssistantWithMode:)])
+                [webview_ useSelectionAssistantWithMode:0];
+
             [webview_ setTilingEnabled:YES];
             [webview_ setDrawsGrid:NO];
             [webview_ setLogsTilingChanges:NO];
             [webview_ setTileMinificationFilter:kCAFilterNearest];
+
             if ([webview_ respondsToSelector:@selector(setDataDetectorTypes:)])
                 /* XXX: abstractify */
                 [webview_ setDataDetectorTypes:0x80000000];
             else
                 [webview_ setDetectsPhoneNumbers:NO];
+
             [webview_ setAutoresizes:YES];
 
             [webview_ setMinimumScale:0.25f forDocumentTypes:0x10];
@@ -1252,8 +1283,13 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize(
             [webview _setUsesLoaderCache:YES];
 
             [webview setGroupName:@"CydiaGroup"];
+
+            WebPreferences *preferences([webview preferences]);
+
             if ([webview respondsToSelector:@selector(_setLayoutInterval:)])
                 [webview _setLayoutInterval:0];
+            else
+                [preferences _setLayoutInterval:0];
         }
 
         [self setViewportWidth:width];
@@ -1270,10 +1306,12 @@ UIActionSheet *mailAlertSheet = [[UIActionSheet alloc] initWithTitle:UCLocalize(
         indirect_ = [[IndirectDelegate alloc] initWithDelegate:self];
 
         [webview setFrameLoadDelegate:indirect_];
+        [webview setPolicyDelegate:indirect_];
         [webview setResourceLoadDelegate:indirect_];
         [webview setUIDelegate:indirect_];
-        [webview setScriptDebugDelegate:indirect_];
-        [webview setPolicyDelegate:indirect_];
+
+        /* XXX: do not turn this on under penalty of extreme pain */
+        [webview setScriptDebugDelegate:nil];
 
         WebThreadUnlock();
 
diff --git a/control b/control
index c59c897011c23fbc5ef67652974bd97c18b6840b..fb262dc51842f3242858425fe8c1224962465121 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: required
 Section: Packaging
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 1.0.2936-1
+Version: 1.0.2942-1
 Replaces: com.sosiphone.addcydia
 Depends: apr-lib, apt7-lib, apt7-key, darwintools, pcre, shell-cmds, system-cmds
 Pre-Depends: dpkg (>= 1.14.25-8)