diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2010-10-04 04:11:27 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-10-04 04:13:11 -0700 |
commit | b72246b0305c1108dc5b911c68e1d0b99e6db313 (patch) | |
tree | 2b2c5f44741fa5d3c3cd6159949633b08669ecc8 /Cydia.mm | |
parent | 939fb3fb814f6df669f5d8780744f4c1891d52b3 (diff) |
Reformat UIHardware$, using autorelease instead of explicit release.
Diffstat (limited to 'Cydia.mm')
-rw-r--r-- | Cydia.mm | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -8663,19 +8663,20 @@ static NSNumber *shouldPlayKeyboardSounds; Class $UIHardware; -MSHook(void, UIHardware$_playSystemSound$, Class self, SEL _cmd, int soundIndex) { - switch (soundIndex) { +MSHook(void, UIHardware$_playSystemSound$, Class self, SEL _cmd, int sound) { + switch (sound) { case 1104: // Keyboard Button Clicked case 1105: // Keyboard Delete Repeated - if (!shouldPlayKeyboardSounds) { - NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.apple.preferences.sounds.plist"]; - shouldPlayKeyboardSounds = [[dict objectForKey:@"keyboard"] ?: (id)kCFBooleanTrue retain]; - [dict release]; + if (shouldPlayKeyboardSounds == nil) { + NSDictionary *dict([[[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.apple.preferences.sounds.plist"] autorelease]); + shouldPlayKeyboardSounds = [([dict objectForKey:@"keyboard"] ?: (id) kCFBooleanTrue) retain]; } + if (![shouldPlayKeyboardSounds boolValue]) break; + default: - _UIHardware$_playSystemSound$(self, _cmd, soundIndex); + _UIHardware$_playSystemSound$(self, _cmd, sound); } } |