]> git.saurik.com Git - cydia.git/blobdiff - MobileCydia.mm
Reload all the crazy different iPad tabs.
[cydia.git] / MobileCydia.mm
index 5d3c6523b2ca6d30dd4f5530faa1e9322562e085..e9ff8fcbd37ecef9f1f73ae12cee422ce23ac0e3 100644 (file)
@@ -7113,7 +7113,7 @@ freeing the view controllers on tab change */
 
 - (void) viewWillDisappear:(BOOL)animated {
     [super viewWillDisappear:animated];
-    [self setEditing:NO];
+    if (editing_) [self setEditing:NO];
 }
 
 - (Section *) sectionAtIndexPath:(NSIndexPath *)indexPath {
@@ -8117,15 +8117,25 @@ static _finline void _setHomePage(Cydia *self) {
 - (void) _updateData {
     [self _saveConfig];
 
-    /* XXX: this is just stupid */
-    if (tag_ != 1 && sections_ != nil)
-        [sections_ reloadData];
-    if (tag_ != 2 && changes_ != nil)
-        [changes_ reloadData];
-    if (tag_ != 4 && search_ != nil)
-        [search_ reloadData];
-
-    [(CYNavigationController *)[tabbar_ selectedViewController] reloadData];
+    NSMutableSet *tabs([[[NSMutableSet alloc] initWithCapacity:10] autorelease]);
+
+    [tabs addObject:[tabbar_ selectedViewController]];
+
+    if (sections_ != nil)
+        [tabs addObject:sections_];
+    if (changes_ != nil)
+        [tabs addObject:changes_];
+    if (manage_ != nil)
+        [tabs addObject:manage_];
+    if (search_ != nil)
+        [tabs addObject:search_];
+    if (sources_ != nil)
+        [tabs addObject:sources_];
+    if (installed_ != nil)
+        [tabs addObject:installed_];
+
+    for (CYNavigationController *tab in tabs)
+        [tab reloadData];
 
     [queueDelegate_ queueStatusDidChange];
     [[[self queueBadgeController] tabBarItem] setBadgeValue:(Queuing_ ? UCLocalize("Q_D") : nil)];