summaryrefslogtreecommitdiff
path: root/Cydia.mm
diff options
context:
space:
mode:
authorGrant Paul <chpwn@chpwn.com>2010-10-03 01:49:57 -0700
committerJay Freeman <saurik@Jay-Freemans-MacBook-Pro.local>2010-10-04 00:12:22 -0700
commit124c62018639ce0466b2676e9b2475a0086a97e8 (patch)
tree74b8caeae34ce2cf79ced65c23140df65df4487f /Cydia.mm
parent3bc2724a0d2ba19407513f44498a29bf64f1db69 (diff)
Don't bother updating data if we aren't actually, like, changing anything.
Diffstat (limited to 'Cydia.mm')
-rw-r--r--Cydia.mm24
1 files changed, 15 insertions, 9 deletions
diff --git a/Cydia.mm b/Cydia.mm
index a260c89..af9b8da 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -7547,23 +7547,29 @@ freeing the view controllers on tab change */
}
- (void) save {
+ NSString *role = nil;
+
switch ([segment_ selectedSegmentIndex]) {
- case 0: Role_ = @"User"; break;
- case 1: Role_ = @"Hacker"; break;
- case 2: Role_ = @"Developer"; break;
+ case 0: role = @"User"; break;
+ case 1: role = @"Hacker"; break;
+ case 2: role = @"Developer"; break;
_nodefault
}
- Settings_ = [NSMutableDictionary dictionaryWithObjectsAndKeys:
- Role_, @"Role",
- nil];
+ if (![role isEqualToString:Role_]) {
+ Role_ = role;
+
+ Settings_ = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ Role_, @"Role",
+ nil];
- [Metadata_ setObject:Settings_ forKey:@"Settings"];
+ [Metadata_ setObject:Settings_ forKey:@"Settings"];
- Changed_ = true;
+ Changed_ = true;
- [roledelegate_ updateData];
+ [roledelegate_ updateData];
+ }
}
- (void) segmentChanged:(UISegmentedControl *)control {