diff options
author | rowanbeentje <rowan@beent.je> | 2010-05-22 12:21:54 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-05-22 12:21:54 +0000 |
commit | 76633d986085d3b9d05f73db8d51aefdf1f68dfb (patch) | |
tree | e36758acc38f519560b1fe0b1b0c476b03b27d46 /Source/TablesList.m | |
parent | bd78aaeadb8dfd0eb83a896727e6376109c12e22 (diff) | |
download | sequelpro-76633d986085d3b9d05f73db8d51aefdf1f68dfb.tar.gz sequelpro-76633d986085d3b9d05f73db8d51aefdf1f68dfb.tar.bz2 sequelpro-76633d986085d3b9d05f73db8d51aefdf1f68dfb.zip |
- Fix an issue when truncating tables using the right-click menu, by improving the truncation reload code and by removing a problem in TableContent tracking the active table name. This addresses Issue #700 and a number of crash reports.
- Rename SPHistoryView* constants to SPTableView* constants and use them more widely rather than hard-coded tab indexes
- Fix a problem preventing history navigation if a triggers view was the previous item in the history
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r-- | Source/TablesList.m | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m index aae23689..2a77db53 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -698,20 +698,20 @@ statusLoaded = NO; triggersLoaded = NO; if( selectedTableType == SPTableTypeView || selectedTableType == SPTableTypeTable) { - if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 0 ) { + if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewStructure ) { [tableSourceInstance loadTable:selectedTableName]; structureLoaded = YES; - } else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 1 ) { + } else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewContent ) { if(tableEncoding == nil) { [tableContentInstance loadTable:nil]; } else { [tableContentInstance loadTable:selectedTableName]; } contentLoaded = YES; - } else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 3 ) { + } else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewStatus ) { [[extendedTableInfoInstance onMainThread] loadTable:selectedTableName]; statusLoaded = YES; - } else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 5 ) { + } else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewTriggers ) { [[tableTriggersInstance onMainThread] loadTriggers]; triggersLoaded = YES; } @@ -1360,19 +1360,19 @@ contentLoaded = NO; triggersLoaded = NO; switch ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]]) { - case 0: + case SPTableViewStructure: [tableSourceInstance loadTable:newTableName]; structureLoaded = YES; break; - case 1: + case SPTableViewContent: [tableContentInstance loadTable:newTableName]; contentLoaded = YES; break; - case 3: + case SPTableViewStatus: [extendedTableInfoInstance loadTable:newTableName]; statusLoaded = YES; break; - case 5: + case SPTableViewTriggers: [tableTriggersInstance loadTriggers]; triggersLoaded = YES; break; @@ -1564,22 +1564,22 @@ && ([self tableType] == SPTableTypeTable || [self tableType] == SPTableTypeView) ) { - if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 0) && !structureLoaded ) { + if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewStructure) && !structureLoaded ) { [tableSourceInstance loadTable:selectedTableName]; structureLoaded = YES; } - if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 1) && !contentLoaded ) { + if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewContent) && !contentLoaded ) { [tableContentInstance loadTable:selectedTableName]; contentLoaded = YES; } - if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 3) && !statusLoaded ) { + if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewStatus) && !statusLoaded ) { [[extendedTableInfoInstance onMainThread] loadTable:selectedTableName]; statusLoaded = YES; } - if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 5) && !triggersLoaded ) { + if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewTriggers) && !triggersLoaded ) { [[tableTriggersInstance onMainThread] loadTriggers]; triggersLoaded = YES; } @@ -2010,10 +2010,14 @@ currentIndex = [indexes indexLessThanIndex:currentIndex]; } - // Reload the table's content view to show that it has been truncated - [tableContentInstance reloadTable:self]; - [tableDataInstance resetStatusData]; + // Ensure the the table's content view is updated to show that it has been truncated + if ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == SPTableViewContent) { + [tableContentInstance reloadTable:self]; + } else { + [self setContentRequiresReload:YES]; + } + [tableDataInstance resetStatusData]; } /** |