[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[647] trunk/fuse/fusepb
Brought to you by:
fredm
From: <fr...@us...> - 2010-09-28 11:58:26
|
Revision: 647 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=647&view=rev Author: fredm Date: 2010-09-28 11:58:20 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Use @property and friends for accessors where possible. Modified Paths: -------------- trunk/fuse/fusepb/content_arrays/CAMachines.h trunk/fuse/fusepb/content_arrays/CAMachines.m trunk/fuse/fusepb/content_arrays/HIDJoysticks.h trunk/fuse/fusepb/content_arrays/HIDJoysticks.m trunk/fuse/fusepb/content_arrays/Joysticks.h trunk/fuse/fusepb/content_arrays/Joysticks.m trunk/fuse/fusepb/controllers/FuseController.h trunk/fuse/fusepb/controllers/FuseController.m trunk/fuse/fusepb/controllers/TapeBrowserController.h trunk/fuse/fusepb/controllers/TapeBrowserController.m trunk/fuse/fusepb/models/Emulator.h trunk/fuse/fusepb/models/Emulator.m trunk/fuse/fusepb/views/Texture.h trunk/fuse/fusepb/views/Texture.m Modified: trunk/fuse/fusepb/content_arrays/CAMachines.h =================================================================== --- trunk/fuse/fusepb/content_arrays/CAMachines.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/content_arrays/CAMachines.h 2010-09-28 11:58:20 UTC (rev 647) @@ -36,10 +36,8 @@ + (id)machineWithName:(NSString *)aTitle andType:(int)aValue; + (Machine *)machineForName:(NSString *)theName; + (Machine *)machineForType:(int)theType; -- (int)machineType; -- (void)setMachineType:(int)aValue; -- (NSString *)machineName; -- (void)setMachineName:(NSString *)aName; +@property (copy,getter=machineName,setter=setMachineName) NSString *name; +@property (getter=machineType,setter=setMachineType:) int type; - (id)copyWithZone:(NSZone *)zone; - (id)valueForUndefinedKey:(NSString *)key; Modified: trunk/fuse/fusepb/content_arrays/CAMachines.m =================================================================== --- trunk/fuse/fusepb/content_arrays/CAMachines.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/content_arrays/CAMachines.m 2010-09-28 11:58:20 UTC (rev 647) @@ -120,30 +120,9 @@ // Accessors -- (NSString *)machineName -{ - return name; -} +@synthesize name; +@synthesize type; -- (void)setMachineName:(NSString *)aName -{ - if (name != aName) { - [name release]; - name = [aName copy]; - } - return; -} - -- (int)machineType -{ - return type; -} - -- (void)setMachineType:(int)aValue -{ - type = aValue; -} - - (void)dealloc { [self setMachineName:nil]; Modified: trunk/fuse/fusepb/content_arrays/HIDJoysticks.h =================================================================== --- trunk/fuse/fusepb/content_arrays/HIDJoysticks.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/content_arrays/HIDJoysticks.h 2010-09-28 11:58:20 UTC (rev 647) @@ -36,10 +36,8 @@ + (id)joystickWithName:(NSString *)aTitle andType:(int)aValue; + (HIDJoystick *)joystickForName:(NSString *)theName; + (HIDJoystick *)joystickForType:(int)theType; -- (int)joystickType; -- (void)setJoystickType:(int)aValue; -- (NSString *)joystickName; -- (void)setJoystickName:(NSString *)aName; +@property (retain,getter=joystickName,setter=setJoystickName:) NSString *name; +@property (getter=joystickType,setter=setJoystickType:) int type; - (id)copyWithZone:(NSZone *)zone; - (id)valueForUndefinedKey:(NSString *)key; Modified: trunk/fuse/fusepb/content_arrays/HIDJoysticks.m =================================================================== --- trunk/fuse/fusepb/content_arrays/HIDJoysticks.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/content_arrays/HIDJoysticks.m 2010-09-28 11:58:20 UTC (rev 647) @@ -124,30 +124,9 @@ // Accessors -- (NSString *)joystickName -{ - return name; -} +@synthesize name; +@synthesize type; -- (void)setJoystickName:(NSString *)aName -{ - if (name != aName) { - [name release]; - name = [aName copy]; - } - return; -} - -- (int)joystickType -{ - return type; -} - -- (void)setJoystickType:(int)aValue -{ - type = aValue; -} - - (void)dealloc { [self setJoystickName:nil]; Modified: trunk/fuse/fusepb/content_arrays/Joysticks.h =================================================================== --- trunk/fuse/fusepb/content_arrays/Joysticks.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/content_arrays/Joysticks.h 2010-09-28 11:58:20 UTC (rev 647) @@ -36,10 +36,8 @@ + (id)joystickWithName:(NSString *)aTitle andType:(int)aValue; + (Joystick *)joystickForName:(NSString *)theName; + (Joystick *)joystickForType:(int)theType; -- (int)joystickType; -- (void)setJoystickType:(int)aValue; -- (NSString *)joystickName; -- (void)setJoystickName:(NSString *)aName; +@property (retain,getter=joystickName,setter=setJoystickName:) NSString *name; +@property (getter=joystickType,setter=setJoystickType:) int type; - (id)copyWithZone:(NSZone *)zone; - (id)valueForUndefinedKey:(NSString *)key; Modified: trunk/fuse/fusepb/content_arrays/Joysticks.m =================================================================== --- trunk/fuse/fusepb/content_arrays/Joysticks.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/content_arrays/Joysticks.m 2010-09-28 11:58:20 UTC (rev 647) @@ -120,30 +120,9 @@ // Accessors -- (NSString *)joystickName -{ - return name; -} +@synthesize name; +@synthesize type; -- (void)setJoystickName:(NSString *)aName -{ - if (name != aName) { - [name release]; - name = [aName copy]; - } - return; -} - -- (int)joystickType -{ - return type; -} - -- (void)setJoystickType:(int)aValue -{ - type = aValue; -} - - (void)dealloc { [self setJoystickName:nil]; Modified: trunk/fuse/fusepb/controllers/FuseController.h =================================================================== --- trunk/fuse/fusepb/controllers/FuseController.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/controllers/FuseController.h 2010-09-28 11:58:20 UTC (rev 647) @@ -146,7 +146,7 @@ - (IBAction)saveFileTypeClicked:(id)sender; - savePanelAccessoryView; -- (NSPopUpButton*) saveFileType; +@property (getter=saveFileType,readonly) NSPopUpButton* saveFileType; - (void)releaseCmdKeys:(NSString *)character:(int)keyCode; - (void)releaseKey:(int)keyCode; Modified: trunk/fuse/fusepb/controllers/FuseController.m =================================================================== --- trunk/fuse/fusepb/controllers/FuseController.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/controllers/FuseController.m 2010-09-28 11:58:20 UTC (rev 647) @@ -1046,10 +1046,7 @@ return savePanelAccessoryView; } -- (NSPopUpButton*) saveFileType -{ - return saveFileType; -} +@synthesize saveFileType; - (IBAction)resetUserDefaults:(id)sender { Modified: trunk/fuse/fusepb/controllers/TapeBrowserController.h =================================================================== --- trunk/fuse/fusepb/controllers/TapeBrowserController.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/controllers/TapeBrowserController.h 2010-09-28 11:58:20 UTC (rev 647) @@ -49,7 +49,6 @@ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification; -- (NSArrayController *)tapeController; -- (NSArrayController *)infoController; - +@property (retain,getter=tapeController,readonly) NSArrayController *tapeController; +@property (retain,getter=infoController,readonly) NSArrayController *infoController; @end Modified: trunk/fuse/fusepb/controllers/TapeBrowserController.m =================================================================== --- trunk/fuse/fusepb/controllers/TapeBrowserController.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/controllers/TapeBrowserController.m 2010-09-28 11:58:20 UTC (rev 647) @@ -129,16 +129,8 @@ initialising = [value boolValue]; } -- (NSArrayController *)tapeController -{ - return [[tapeController retain] autorelease]; -} - -- (NSArrayController *)infoController -{ - return [[infoController retain] autorelease]; -} - +@synthesize tapeController; +@synthesize infoController; @end static void Modified: trunk/fuse/fusepb/models/Emulator.h =================================================================== --- trunk/fuse/fusepb/models/Emulator.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/models/Emulator.h 2010-09-28 11:58:20 UTC (rev 647) @@ -53,8 +53,6 @@ -(void) connectWithPorts:(NSArray *)portArray; -(void) stop; --(BOOL) isEmulating; - -(void) startEmulationTimer; -(void) stopEmulationTimer; @@ -191,4 +189,5 @@ -(void) debuggerActivate; +@property (getter=isEmulating,readonly) BOOL isEmulating; @end Modified: trunk/fuse/fusepb/models/Emulator.m =================================================================== --- trunk/fuse/fusepb/models/Emulator.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/models/Emulator.m 2010-09-28 11:58:20 UTC (rev 647) @@ -620,10 +620,7 @@ return divide_eject( unit ); } --(BOOL) isEmulating -{ - return isEmulating; -} +@synthesize isEmulating; -(void) startEmulationTimer { Modified: trunk/fuse/fusepb/views/Texture.h =================================================================== --- trunk/fuse/fusepb/views/Texture.h 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/views/Texture.h 2010-09-28 11:58:20 UTC (rev 647) @@ -40,7 +40,7 @@ -(void) dealloc; -(Cocoa_Texture*) getTexture; --(GLuint) getTextureId; +@property (getter=getTextureId,readonly) GLuint textureId; -(void) uploadIconTexture; Modified: trunk/fuse/fusepb/views/Texture.m =================================================================== --- trunk/fuse/fusepb/views/Texture.m 2010-09-24 12:32:35 UTC (rev 646) +++ trunk/fuse/fusepb/views/Texture.m 2010-09-28 11:58:20 UTC (rev 647) @@ -93,10 +93,7 @@ return &texture; } --(GLuint) getTextureId -{ - return textureId; -} +@synthesize textureId; -(void) uploadIconTexture; { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |