From 2d5372fc68a056bb33511b7c940dbad6b7551f80 Mon Sep 17 00:00:00 2001 From: Grant Paul Date: Thu, 17 Feb 2011 21:29:22 -0800 Subject: Fixed reloading of SourceController by re-mapping the source_ by the Source's uri on -reloadData. --- MobileCydia.mm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index b53372b..728b550 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -7643,7 +7643,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { /* }}} */ /* Source Controller {{{ */ @interface SourceController : FilteredPackageListController { - Source *source_; + _transient Source *source_; + NSString *uri_; } - (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; + uri_ = [source uri]; 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 {{{ */ -- cgit v1.2.3