Index: src/PGConnection.h ================================================================== --- src/PGConnection.h +++ src/PGConnection.h @@ -8,16 +8,12 @@ { PGconn *_connnection; OFDictionary *_parameters; } -#ifdef OF_HAVE_PROPERTIES @property (copy) OFDictionary *parameters; -#endif -- (void)setParameters: (OFDictionary*)parameters; -- (OFDictionary*)parameters; - (void)connect; - (void)reset; - (void)close; - (PGResult*)executeCommand: (OFConstantString*)command; - (PGResult*)executeCommand: (OFConstantString*)command Index: src/PGConnection.m ================================================================== --- src/PGConnection.m +++ src/PGConnection.m @@ -2,29 +2,21 @@ #import "PGConnectionFailedException.h" #import "PGCommandFailedException.h" @implementation PGConnection +@synthesize parameters = _parameters; + - (void)dealloc { [_parameters release]; [self close]; [super dealloc]; } -- (void)setParameters: (OFDictionary*)parameters -{ - OF_SETTER(_parameters, parameters, YES, YES) -} - -- (OFDictionary*)parameters -{ - OF_GETTER(_parameters, YES) -} - - (void)connect { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFEnumerator *keyEnumerator = [_parameters keyEnumerator]; OFEnumerator *objectEnumerator = [_parameters objectEnumerator]; Index: src/exceptions/PGCommandFailedException.h ================================================================== --- src/exceptions/PGCommandFailedException.h +++ src/exceptions/PGCommandFailedException.h @@ -3,15 +3,12 @@ @interface PGCommandFailedException: PGException { OFString *_command; } -#ifdef OF_HAVE_PROPERTIES -@property (readonly, copy, nonatomic) OFString *command; -#endif +@property (readonly, copy) OFString *command; + (instancetype)exceptionWithConnection: (PGConnection*)connection command: (OFString*)command; - initWithConnection: (PGConnection*)connection command: (OFString*)command; -- (OFString*)command; @end Index: src/exceptions/PGCommandFailedException.m ================================================================== --- src/exceptions/PGCommandFailedException.m +++ src/exceptions/PGCommandFailedException.m @@ -1,8 +1,10 @@ #import "PGCommandFailedException.h" @implementation PGCommandFailedException +@synthesize command = _command; + + (instancetype)exceptionWithConnection: (PGConnection*)connection command: (OFString*)command { return [[[self alloc] initWithConnection: connection command: command] autorelease]; @@ -33,11 +35,6 @@ - (OFString*)description { return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n" @"Command: %@", _error, _command]; } - -- (OFString*)command -{ - OF_GETTER(_command, NO) -} @end Index: src/exceptions/PGException.h ================================================================== --- src/exceptions/PGException.h +++ src/exceptions/PGException.h @@ -6,13 +6,10 @@ { PGConnection *_connection; OFString *_error; } -#ifdef OF_HAVE_PROPERTIES -@property (readonly, retain, nonatomic) PGConnection *connection; -#endif +@property (readonly, retain) PGConnection *connection; + (instancetype)exceptionWithConnection: (PGConnection*)connection; - initWithConnection: (PGConnection*)connection; -- (PGConnection*)connection; @end Index: src/exceptions/PGException.m ================================================================== --- src/exceptions/PGException.m +++ src/exceptions/PGException.m @@ -1,8 +1,10 @@ #import "PGException.h" @implementation PGException +@synthesize connection = _connection; + + (instancetype)exceptionWithConnection: (PGConnection*)connection { return [[[self alloc] initWithConnection: connection] autorelease]; } @@ -34,11 +36,6 @@ - (OFString*)description { return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@", _error]; } - -- (PGConnection*)connection -{ - OF_GETTER(_connection, NO) -} @end