aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-08-16 00:15:28 +0000
committerrowanbeentje <rowan@beent.je>2010-08-16 00:15:28 +0000
commita4b8942109134428b04f355679e410146d07ff89 (patch)
tree56d8169ec47c41881b1b59ee6abe22b8189b5af7 /Source/SPDatabaseDocument.m
parent0d927d60ad66010af39e7c171ebbac4feb5e84f4 (diff)
downloadsequelpro-a4b8942109134428b04f355679e410146d07ff89.tar.gz
sequelpro-a4b8942109134428b04f355679e410146d07ff89.tar.bz2
sequelpro-a4b8942109134428b04f355679e410146d07ff89.zip
- 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)
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;
}
}