From a4b8942109134428b04f355679e410146d07ff89 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 16 Aug 2010 00:15:28 +0000 Subject: - Apply column autosizing improvements to custom query loading - Move Table Content progress tracking onto the main thread's load timer - Improve thread safety when autosizing - Improve autosize to not contrain wide columns as much in tables where all columns can be shown, or if the column is double-clicked to size. (This completes work on Issue #271 and Issue #272) --- Source/SPDatabaseDocument.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 21d5034a..a31a9ac7 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1387,10 +1387,14 @@ // Check the supplied progress. Compare it to the display interval - how often // the interface is updated - and update the interface if the value has changed enough. taskProgressValue = taskPercentage; - if (taskProgressValue > taskDisplayLastValue + taskProgressValueDisplayInterval - || taskProgressValue < taskDisplayLastValue - taskProgressValueDisplayInterval) + if (taskProgressValue >= taskDisplayLastValue + taskProgressValueDisplayInterval + || taskProgressValue <= taskDisplayLastValue - taskProgressValueDisplayInterval) { - [taskProgressIndicator performSelectorOnMainThread:@selector(setNumberValue:) withObject:[NSNumber numberWithDouble:taskProgressValue] waitUntilDone:NO]; + if ([NSThread isMainThread]) { + [taskProgressIndicator setDoubleValue:taskProgressValue]; + } else { + [taskProgressIndicator performSelectorOnMainThread:@selector(setNumberValue:) withObject:[NSNumber numberWithDouble:taskProgressValue] waitUntilDone:NO]; + } taskDisplayLastValue = taskProgressValue; } } -- cgit v1.2.3