diff options
author | Max <post@wickenrode.com> | 2015-07-19 04:57:49 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-07-19 04:57:49 +0200 |
commit | c1580fb4e585a16348b59641ba0e1ebe19b99062 (patch) | |
tree | e47eff237a7c2f4eb71576ff7260914a8d261bf0 /Source | |
parent | e5d6e1125a34ac0c74df6099ee453350e9c29e69 (diff) | |
download | sequelpro-c1580fb4e585a16348b59641ba0e1ebe19b99062.tar.gz sequelpro-c1580fb4e585a16348b59641ba0e1ebe19b99062.tar.bz2 sequelpro-c1580fb4e585a16348b59641ba0e1ebe19b99062.zip |
Replace a setter with @property
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPTableData.h | 2 | ||||
-rw-r--r-- | Source/SPTableData.m | 16 |
2 files changed, 3 insertions, 15 deletions
diff --git a/Source/SPTableData.h b/Source/SPTableData.h index 1b457ca7..05783256 100644 --- a/Source/SPTableData.h +++ b/Source/SPTableData.h @@ -55,8 +55,8 @@ } @property (readonly, assign) BOOL tableHasAutoIncrementField; +@property (nonatomic, retain) SPMySQLConnection *connection; -- (void) setConnection:(SPMySQLConnection *)theConnection; - (NSString *) tableEncoding; - (NSString *) tableCreateSyntax; - (NSArray *) columns; diff --git a/Source/SPTableData.m b/Source/SPTableData.m index cb98183e..27dd4ea1 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -48,6 +48,7 @@ @implementation SPTableData @synthesize tableHasAutoIncrementField; +@synthesize connection = mySQLConnection; - (id) init { @@ -61,7 +62,6 @@ triggers = nil; tableEncoding = nil; tableCreateSyntax = nil; - mySQLConnection = nil; tableHasAutoIncrementField = NO; pthread_mutex_init(&dataProcessingLock, NULL); @@ -71,18 +71,6 @@ } /** - * Set the connection for use. - * Called by the connect sheet methods. - * - * @param theConnection The used connection for the SPDatabaseDocument - */ -- (void) setConnection:(SPMySQLConnection *)theConnection -{ - mySQLConnection = theConnection; - [mySQLConnection retain]; -} - -/** * Retrieve the encoding for the current table, using or refreshing the cache as appropriate. */ - (NSString *) tableEncoding @@ -1415,7 +1403,7 @@ if (triggers) SPClear(triggers); if (tableEncoding) SPClear(tableEncoding); if (tableCreateSyntax) SPClear(tableCreateSyntax); - if (mySQLConnection) SPClear(mySQLConnection); + [self setConnection:nil]; pthread_mutex_destroy(&dataProcessingLock); |