]> git.saurik.com Git - cydia.git/blobdiff - MobileCydia.mm
Only run the UIActivityIndicatorView animation while visible.
[cydia.git] / MobileCydia.mm
index 4dd2b57c092b6e6ff9269773232594f719cad69b..c6ba06d03fd39f241a654acbe03637368d318cc5 100644 (file)
@@ -121,6 +121,7 @@ extern "C" {
 #include <Cytore.hpp>
 
 #include "UICaboodle/BrowserView.h"
 #include <Cytore.hpp>
 
 #include "UICaboodle/BrowserView.h"
+#include "SDURLCache/SDURLCache.h"
 
 #include "substrate.h"
 /* }}} */
 
 #include "substrate.h"
 /* }}} */
@@ -2206,7 +2207,6 @@ struct PackageNameOrdering :
         _end
 
         _profile(Package$initWithVersion$Cache)
         _end
 
         _profile(Package$initWithVersion$Cache)
-            id_.set(NULL, iterator.Name());
             name_.set(NULL, iterator.Display());
 
             latest_.set(NULL, StripVersion_(version_.VerStr()));
             name_.set(NULL, iterator.Display());
 
             latest_.set(NULL, StripVersion_(version_.VerStr()));
@@ -2216,19 +2216,6 @@ struct PackageNameOrdering :
                 installed_.set(NULL, StripVersion_(current.VerStr()));
         _end
 
                 installed_.set(NULL, StripVersion_(current.VerStr()));
         _end
 
-        _profile(Package$initWithVersion$Lower)
-            // XXX: do not use tolower() as this is not locale-specific? :(
-            char *data(id_.data());
-            for (size_t i(0), e(id_.size()); i != e; ++i)
-                if ((data[i] & 0x20) == 0) {
-                    id_.copy(pool);
-                    data = id_.data();
-                    for (; i != e; ++i)
-                        data[i] |= 0x20;
-                    break;
-                }
-        _end
-
         _profile(Package$initWithVersion$Tags)
             pkgCache::TagIterator tag(iterator.TagList());
             if (!tag.end()) {
         _profile(Package$initWithVersion$Tags)
             pkgCache::TagIterator tag(iterator.TagList());
             if (!tag.end()) {
@@ -2253,9 +2240,19 @@ struct PackageNameOrdering :
         _end
 
         _profile(Package$initWithVersion$Metadata)
         _end
 
         _profile(Package$initWithVersion$Metadata)
-            PackageValue *metadata(PackageFind(id_.data(), id_.size()));
+            const char *mixed(iterator.Name());
+            size_t size(strlen(mixed));
+            char lower[size + 1];
+
+            for (size_t i(0); i != size; ++i)
+                lower[i] = mixed[i] | 0x20;
+            lower[size] = '\0';
+
+            PackageValue *metadata(PackageFind(lower, size));
             metadata_ = metadata;
 
             metadata_ = metadata;
 
+            id_.set(NULL, metadata->name_, size);
+
             const char *latest(version_.VerStr());
             size_t length(strlen(latest));
 
             const char *latest(version_.VerStr());
             size_t length(strlen(latest));
 
@@ -3363,7 +3360,9 @@ static NSString *Warning_;
     cache_.Close();
 
     apr_pool_clear(pool_);
     cache_.Close();
 
     apr_pool_clear(pool_);
+
     NSRecycleZone(zone_);
     NSRecycleZone(zone_);
+    zone_ = NSCreateZone(1024 * 1024, 256 * 1024, NO);
 
     int chk(creat("/tmp/cydia.chk", 0644));
     if (chk != -1)
 
     int chk(creat("/tmp/cydia.chk", 0644));
     if (chk != -1)
@@ -8746,6 +8745,12 @@ static _finline void _setHomePage(Cydia *self) {
 
 - (void) applicationDidFinishLaunching:(id)unused {
 _trace();
 
 - (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]];
     [CYBrowserController _initialize];
 
     [NSURLProtocol registerClass:[CydiaURLProtocol class]];