From bb3d00cbae9442fcf6e400e8e2bb30b1884d9637 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 10 Apr 2016 12:22:25 -0400 Subject: [PATCH] Clean up +[AppDelegate load] to use ObjC 2.0 literal syntax. --- Source/AppDelegate.m | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index fc8c185..d3ab27b 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -1,16 +1,16 @@ /* * MacGDBp * Copyright (c) 2007 - 2011, Blue Static - * - * This program is free software; you can redistribute it and/or modify it under the terms of the GNU - * General Public License as published by the Free Software Foundation; either version 2 of the + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with this program; if not, + * + * You should have received a copy of the GNU General Public License along with this program; if not, * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ @@ -30,23 +30,17 @@ */ + (void)load { - NSAutoreleasePool* pool = [NSAutoreleasePool new]; - - NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithInt:9000], @"Port", - [NSNumber numberWithBool:YES], @"BreakpointsWindowVisible", - [NSNumber numberWithBool:YES], @"InspectorWindowVisible", - [NSMutableArray array], @"PathReplacements", - [NSNumber numberWithBool:YES], @"BreakOnFirstLine", - [NSNumber numberWithBool:YES], @"DebuggerAttached", - nil - ]; - - [[NSUserDefaults standardUserDefaults] registerDefaults:dict]; - - [dict release]; - - [pool release]; + @autoreleasepool { + NSDictionary* defaults = @{ + @"Port" : @9000, + @"BreakpointsWindowVisible" : @YES, + @"InspectorWindowVisible" : @YES, + @"PathReplacements" : [NSMutableArray array], + @"BreakOnFirstLine" : @YES, + @"DebuggerAttached" : @YES + }; + [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; + } } + (AppDelegate*)instance -- 2.43.5