diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-26 23:55:33 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:25 -0800 |
commit | 6c0ba3d9b2fd8be364554455ed3add48b1241d06 (patch) | |
tree | 92bd53b8579e5b4cf79f64f5ffb5bab547004a0f /MobileCydia.mm | |
parent | 28e596e4e022e5f11f31f45118bb43d414201672 (diff) |
Reloading the world should really just /un/load the world.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r-- | MobileCydia.mm | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 1eb6051..9057ef7 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -6828,7 +6828,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (NSArray *) navigationURLCollection; - (id) initWithDatabase:(Database *)database; -- (void) reloadData; +- (void) unloadData:(BOOL)selected; @end /* }}} */ @@ -6856,6 +6856,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) beginUpdate; - (void) raiseBar:(BOOL)animated; - (BOOL) updating; +- (void) unloadData; @end @@ -6905,11 +6906,13 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return items; } -- (void) reloadData { - for (CYViewController *controller in [self viewControllers]) - [controller reloadData]; +- (void) unloadData { + CYNavigationController *selected((CYNavigationController *) [self selectedViewController]); + for (CYNavigationController *controller in [self viewControllers]) + [controller unloadData:(controller == selected)]; - [(CYNavigationController *)[self unselectedViewController] reloadData]; + if (CYNavigationController *unselected = (CYNavigationController *) [self unselectedViewController]) + [unselected unloadData:YES]; } - (void) dealloc { @@ -7137,14 +7140,18 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return stack; } -- (void) reloadData { +- (void) unloadData:(BOOL)selected { + CYViewController *top((CYViewController *) [self topViewController]); + bool loaded([top hasLoaded]); + for (CYViewController *page in [self viewControllers]) { - // Only reload controllers that have already loaded. - // This prevents a page from accidentally loading too - // early if it hasn't been shown on the screen yet. - if ([page hasLoaded]) - [page reloadData]; + NSLog(@"%@ %@", page, top); + if (!selected || page != top) + [page unloadData]; } + + if (selected && loaded) + [top reloadData]; } - (void) setDelegate:(id<UINavigationControllerDelegate>)delegate { @@ -9079,7 +9086,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) _updateData { [self _saveConfig]; - [tabbar_ reloadData]; + [tabbar_ unloadData]; CYNavigationController *navigation = [self queueNavigationController]; |