]> git.saurik.com Git - cydia.git/commitdiff
Fixed reloading of SourceController by re-mapping the source_ by the Source's uri...
authorGrant Paul <chpwn@chpwn.com>
Fri, 18 Feb 2011 05:29:22 +0000 (21:29 -0800)
committerGrant Paul <chpwn@chpwn.com>
Fri, 18 Feb 2011 08:44:52 +0000 (00:44 -0800)
MobileCydia.mm

index b53372b7430852e23bd52c3c313d267f211c7d7f..728b55044b052933532a91a00c8d5f8829a69afc 100644 (file)
@@ -7643,7 +7643,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 /* }}} */
 /* Source Controller {{{ */
 @interface SourceController : FilteredPackageListController {
 /* }}} */
 /* Source Controller {{{ */
 @interface SourceController : FilteredPackageListController {
-    Source *source_;
+    _transient Source *source_;
+    NSString *uri_;
 }
 
 - (id) initWithDatabase:(Database *)database source:(Source *)source;
 }
 
 - (id) initWithDatabase:(Database *)database source:(Source *)source;
@@ -7658,11 +7659,27 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
 - (id) initWithDatabase:(Database *)database source:(Source *)source {
     source_ = source;
 
 - (id) initWithDatabase:(Database *)database source:(Source *)source {
     source_ = source;
+    uri_ = [source uri];
 
     if ((self = [super initWithDatabase:database title:[source label] filter:@selector(isVisibleInSource:) with:source]) != nil) {
     } return self;
 }
 
 
     if ((self = [super initWithDatabase:database title:[source label] filter:@selector(isVisibleInSource:) with:source]) != nil) {
     } return self;
 }
 
+- (void) reloadData {
+    NSArray *sources = [database_ sources];
+    for (Source *source in sources) {
+        if ([[source uri] isEqual:uri_]) {
+            source_ = source;
+            uri_ = [source uri];
+            break;
+        }
+    }
+
+    [self setObject:source_];
+
+    [super reloadData];
+}
+
 @end
 /* }}} */
 /* Sources Controller {{{ */
 @end
 /* }}} */
 /* Sources Controller {{{ */