aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m10
1 files changed, 7 insertions, 3 deletions
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;
}
}