diff options
author | Max <post@wickenrode.com> | 2017-05-15 01:01:31 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2017-05-15 01:01:31 +0200 |
commit | 5c717e027db5d5ac2d4bd937d6539ea4c1993257 (patch) | |
tree | 38165d154c4641a5e0d4fc4bb8ce50db0986223f /Source | |
parent | f603e3fe223189a35134a553fd1fcaef7f63ea70 (diff) | |
download | sequelpro-5c717e027db5d5ac2d4bd937d6539ea4c1993257.tar.gz sequelpro-5c717e027db5d5ac2d4bd937d6539ea4c1993257.tar.bz2 sequelpro-5c717e027db5d5ac2d4bd937d6539ea4c1993257.zip |
Apply changes from e1b881b8f893803c4949a69055c4e8106562327d to SPTableContent (part of #2770)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPTableContent.h | 1 | ||||
-rw-r--r-- | Source/SPTableContent.m | 12 |
2 files changed, 2 insertions, 11 deletions
diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h index ac720d01..74329e20 100644 --- a/Source/SPTableContent.h +++ b/Source/SPTableContent.h @@ -125,7 +125,6 @@ BOOL _mainNibLoaded; BOOL isWorking; pthread_mutex_t tableValuesLock; - NSCondition *tableLoadingCondition; #ifndef SP_CODA NSMutableArray *nibObjectsToRelease; #endif diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 62f3b758..0d33c1ae 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -172,7 +172,6 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper usedQuery = [[NSString alloc] initWithString:@""]; tableLoadTimer = nil; - tableLoadingCondition = [NSCondition new]; blackColor = [NSColor blackColor]; lightGrayColor = [NSColor lightGrayColor]; @@ -1056,11 +1055,8 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // Set up the table updates timer and wait for it to notify this thread about completion [[self onMainThread] initTableLoadTimer]; - [tableLoadingCondition lock]; - while (![tableValues dataDownloaded]) { - [tableLoadingCondition waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]]; - } - [tableLoadingCondition unlock]; + [tableValues awaitDataDownloaded]; + tableRowsCount = [tableValues count]; // If the final column autoresize wasn't performed, perform it @@ -1265,10 +1261,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper } if ([tableValues dataDownloaded]) { - [tableLoadingCondition lock]; - [tableLoadingCondition signal]; [self clearTableLoadTimer]; - [tableLoadingCondition unlock]; } // Check whether a table update is required, based on whether new rows are @@ -4226,7 +4219,6 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if(fieldEditor) SPClear(fieldEditor); [self clearTableLoadTimer]; - SPClear(tableLoadingCondition); SPClear(tableValues); pthread_mutex_destroy(&tableValuesLock); SPClear(dataColumns); |