diff options
author | rowanbeentje <rowan@beent.je> | 2010-11-12 01:38:11 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-11-12 01:38:11 +0000 |
commit | b86e805f9b7325e4e4ce144069722f56a0a811b7 (patch) | |
tree | ca16c4d14f86e6f70d12b7394757901b2e00028b /Source | |
parent | 443f8e030ef2bd9e08e82ef45b6c93416124f8de (diff) | |
download | sequelpro-b86e805f9b7325e4e4ce144069722f56a0a811b7.tar.gz sequelpro-b86e805f9b7325e4e4ce144069722f56a0a811b7.tar.bz2 sequelpro-b86e805f9b7325e4e4ce144069722f56a0a811b7.zip |
- Tweak master view loading on table change, avoiding clearing active views unnecessarily. This improves speed slightly by reducing interface interaction, and preserves state better during actions, fixing bugs like Issue #574.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPDatabaseViewController.m | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m index cb5b5bb2..0ea8216e 100644 --- a/Source/SPDatabaseViewController.m +++ b/Source/SPDatabaseViewController.m @@ -434,15 +434,11 @@ // Restore view states as appropriate [spHistoryControllerInstance restoreViewStates]; - // Reset all loaded views + // Mark that all loaded views require their data reloading structureLoaded = NO; contentLoaded = NO; statusLoaded = NO; triggersLoaded = NO; - [tableSourceInstance loadTable:nil]; - [tableContentInstance loadTable:nil]; - [[extendedTableInfoInstance onMainThread] loadTable:nil]; - [[tableTriggersInstance onMainThread] loadTriggers]; // Load the currently selected view if looking at a table or view if (tableEncoding && (selectedTableType == SPTableTypeView || selectedTableType == SPTableTypeTable)) @@ -469,6 +465,14 @@ } } + // Clear any views which haven't been loaded as they weren't visible. Note + // that this should be done after reloading visible views, instead of clearing all + // views, to reduce UI operations and avoid resetting state unnecessarily. + if (!structureLoaded) [tableSourceInstance loadTable:nil]; + if (!contentLoaded) [tableContentInstance loadTable:nil]; + if (!statusLoaded) [[extendedTableInfoInstance onMainThread] loadTable:nil]; + if (!triggersLoaded) [[tableTriggersInstance onMainThread] loadTriggers]; + // Update the "Show Create Syntax" window if it's already opened // according to the selected table/view/proc/func if([[[self onMainThread] getCreateTableSyntaxWindow] isVisible]) |