From 5c717e027db5d5ac2d4bd937d6539ea4c1993257 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 15 May 2017 01:01:31 +0200 Subject: Apply changes from e1b881b8f893803c4949a69055c4e8106562327d to SPTableContent (part of #2770) --- Source/SPTableContent.h | 1 - Source/SPTableContent.m | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'Source') 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); -- cgit v1.2.3