summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-26 23:55:33 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:25 -0800
commit6c0ba3d9b2fd8be364554455ed3add48b1241d06 (patch)
tree92bd53b8579e5b4cf79f64f5ffb5bab547004a0f
parent28e596e4e022e5f11f31f45118bb43d414201672 (diff)
Reloading the world should really just /un/load the world.
-rw-r--r--MobileCydia.mm31
-rw-r--r--UICaboodle/RVPage.h2
-rw-r--r--UICaboodle/RVPage.mm4
3 files changed, 25 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];
diff --git a/UICaboodle/RVPage.h b/UICaboodle/RVPage.h
index 68b6283..5dbccfd 100644
--- a/UICaboodle/RVPage.h
+++ b/UICaboodle/RVPage.h
@@ -15,6 +15,8 @@
// but calling the superclass implementation is *required*.
- (void) reloadData;
+- (void) unloadData;
+
// This URL is used to save the state of the view controller. Return
// nil if you cannot or should not save the URL for this page.
- (NSURL *) navigationURL;
diff --git a/UICaboodle/RVPage.mm b/UICaboodle/RVPage.mm
index 1f366c1..d4803f0 100644
--- a/UICaboodle/RVPage.mm
+++ b/UICaboodle/RVPage.mm
@@ -59,6 +59,10 @@ extern bool IsWildcat_;
loaded_ = YES;
}
+- (void) unloadData {
+ loaded_ = NO;
+}
+
- (NSURL *) navigationURL {
return nil;
}