diff --git a/src/PGConnection.h b/src/PGConnection.h index d314266..b40d2f2 100644 --- a/src/PGConnection.h +++ b/src/PGConnection.h @@ -10,12 +10,8 @@ OFDictionary *_parameters; } -#ifdef OF_HAVE_PROPERTIES @property (copy) OFDictionary *parameters; -#endif -- (void)setParameters: (OFDictionary*)parameters; -- (OFDictionary*)parameters; - (void)connect; - (void)reset; - (void)close; diff --git a/src/PGConnection.m b/src/PGConnection.m index 39232cb..a83980b 100644 --- a/src/PGConnection.m +++ b/src/PGConnection.m @@ -4,6 +4,8 @@ #import "PGCommandFailedException.h" @implementation PGConnection +@synthesize parameters = _parameters; + - (void)dealloc { [_parameters release]; @@ -13,16 +15,6 @@ [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]; diff --git a/src/exceptions/PGCommandFailedException.h b/src/exceptions/PGCommandFailedException.h index 3f2d2de..fbc1725 100644 --- a/src/exceptions/PGCommandFailedException.h +++ b/src/exceptions/PGCommandFailedException.h @@ -5,13 +5,10 @@ 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 diff --git a/src/exceptions/PGCommandFailedException.m b/src/exceptions/PGCommandFailedException.m index 708c597..88325ca 100644 --- a/src/exceptions/PGCommandFailedException.m +++ b/src/exceptions/PGCommandFailedException.m @@ -1,6 +1,8 @@ #import "PGCommandFailedException.h" @implementation PGCommandFailedException +@synthesize command = _command; + + (instancetype)exceptionWithConnection: (PGConnection*)connection command: (OFString*)command { @@ -35,9 +37,4 @@ return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n" @"Command: %@", _error, _command]; } - -- (OFString*)command -{ - OF_GETTER(_command, NO) -} @end diff --git a/src/exceptions/PGException.h b/src/exceptions/PGException.h index b1198cb..22d0928 100644 --- a/src/exceptions/PGException.h +++ b/src/exceptions/PGException.h @@ -8,11 +8,8 @@ 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 diff --git a/src/exceptions/PGException.m b/src/exceptions/PGException.m index 00bcc89..59271f2 100644 --- a/src/exceptions/PGException.m +++ b/src/exceptions/PGException.m @@ -1,6 +1,8 @@ #import "PGException.h" @implementation PGException +@synthesize connection = _connection; + + (instancetype)exceptionWithConnection: (PGConnection*)connection { return [[[self alloc] initWithConnection: connection] autorelease]; @@ -36,9 +38,4 @@ return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@", _error]; } - -- (PGConnection*)connection -{ - OF_GETTER(_connection, NO) -} @end