diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-10 18:43:18 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-10 18:43:18 +0000 |
| commit | 4b4f074b6659f33b4f9e1c9784861409d8debd97 (patch) | |
| tree | 0fbd7f1ea28c9431cd8bafbaaac5d689d55d5dd6 /macosx/plugins/DFCdrom | |
| parent | a3ac4842bd5c7058b1363f7d3307f61724fc7178 (diff) | |
Convert Objective-C code to modern syntax, mainly for the NSDictionaries.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87115 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFCdrom')
| -rwxr-xr-x | macosx/plugins/DFCdrom/macsrc/PluginConfigController.m | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m index 6ea5d12f..df20efb2 100755 --- a/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFCdrom/macsrc/PluginConfigController.m @@ -58,14 +58,12 @@ void AboutDlgProc() [icon setSize:size]; NSDictionary *infoPaneDict = - [[NSDictionary alloc] initWithObjectsAndKeys: - [bundle objectForInfoDictionaryKey:@"CFBundleName"], @"ApplicationName", - icon, @"ApplicationIcon", - [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"], @"ApplicationVersion", - [bundle objectForInfoDictionaryKey:@"CFBundleVersion"], @"Version", - [bundle objectForInfoDictionaryKey:@"NSHumanReadableCopyright"], @"Copyright", - credits, @"Credits", - nil]; + @{@"ApplicationName": [bundle objectForInfoDictionaryKey:@"CFBundleName"], + @"ApplicationIcon": icon, + @"ApplicationVersion": [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"], + @"Version": [bundle objectForInfoDictionaryKey:@"CFBundleVersion"], + @"Copyright": [bundle objectForInfoDictionaryKey:@"NSHumanReadableCopyright"], + @"Credits": credits}; dispatch_async(dispatch_get_main_queue(), ^{ [NSApp orderFrontStandardAboutPanelWithOptions:infoPaneDict]; }); @@ -92,18 +90,15 @@ void ReadConfig() { NSDictionary *keyValues; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: - [NSDictionary dictionaryWithObjectsAndKeys: - @YES, @"Threaded", - @64, @"Cache Size", - @0, @"Speed", - nil], PrefsKey, nil]]; + [defaults registerDefaults:@{PrefsKey: @{@"Threaded": @YES, + @"Cache Size": @64, + @"Speed": @0}}]; keyValues = [defaults dictionaryForKey:PrefsKey]; - ReadMode = ([[keyValues objectForKey:@"Threaded"] boolValue] ? THREADED : NORMAL); - CacheSize = [[keyValues objectForKey:@"Cache Size"] intValue]; - CdrSpeed = [[keyValues objectForKey:@"Speed"] integerValue]; + ReadMode = ([keyValues[@"Threaded"] boolValue] ? THREADED : NORMAL); + CacheSize = [keyValues[@"Cache Size"] intValue]; + CdrSpeed = [keyValues[@"Speed"] integerValue]; } @implementation PluginConfigController @@ -121,17 +116,17 @@ void ReadConfig() NSMutableDictionary *writeDic = [keyValues mutableCopy]; - [writeDic setObject:([Cached intValue] ? @YES : @NO) forKey:@"Threaded"]; - [writeDic setObject:@([CacheSize integerValue]) forKey:@"Cache Size"]; + writeDic[@"Threaded"] = ([Cached intValue] ? @YES : @NO); + writeDic[@"Cache Size"] = @([CacheSize integerValue]); switch ([CdSpeed indexOfSelectedItem]) { - case 1: [writeDic setObject:@1 forKey:@"Speed"]; break; - case 2: [writeDic setObject:@2 forKey:@"Speed"]; break; - case 3: [writeDic setObject:@4 forKey:@"Speed"]; break; - case 4: [writeDic setObject:@8 forKey:@"Speed"]; break; - case 5: [writeDic setObject:@16 forKey:@"Speed"]; break; - case 6: [writeDic setObject:@32 forKey:@"Speed"]; break; - default: [writeDic setObject:@0 forKey:@"Speed"]; break; + case 1: writeDic[@"Speed"] = @1; break; + case 2: writeDic[@"Speed"] = @2; break; + case 3: writeDic[@"Speed"] = @4; break; + case 4: writeDic[@"Speed"] = @8; break; + case 5: writeDic[@"Speed"] = @16; break; + case 6: writeDic[@"Speed"] = @32; break; + default: writeDic[@"Speed"] = @0; break; } // write to defaults @@ -154,10 +149,10 @@ void ReadConfig() // load from preferences self.keyValues = [NSMutableDictionary dictionaryWithDictionary:[defaults dictionaryForKey:PrefsKey]]; - [Cached setIntValue:[[keyValues objectForKey:@"Threaded"] intValue]]; - [CacheSize setIntegerValue:[[keyValues objectForKey:@"Cache Size"] integerValue]]; + [Cached setIntValue:[keyValues[@"Threaded"] intValue]]; + [CacheSize setIntegerValue:[keyValues[@"Cache Size"] integerValue]]; - switch ([[keyValues objectForKey:@"Speed"] intValue]) { + switch ([keyValues[@"Speed"] intValue]) { case 1: [CdSpeed selectItemAtIndex:1]; break; case 2: [CdSpeed selectItemAtIndex:2]; break; case 4: [CdSpeed selectItemAtIndex:3]; break; |
