diff options
author | Grant Paul <chpwn@chpwn.com> | 2011-02-17 21:29:22 -0800 |
---|---|---|
committer | Grant Paul <chpwn@chpwn.com> | 2011-02-18 00:44:52 -0800 |
commit | 2d5372fc68a056bb33511b7c940dbad6b7551f80 (patch) | |
tree | 125592c0948542d2b32adb0335cc95402dcc649c | |
parent | 1916f3160661d6fa56be536d701925e1731b529b (diff) |
Fixed reloading of SourceController by re-mapping the source_ by the Source's uri on -reloadData.
-rw-r--r-- | MobileCydia.mm | 19 |
1 files changed, 18 insertions, 1 deletions
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 {{{ */ |