diff options
author | rowanbeentje <rowan@beent.je> | 2009-06-24 23:52:47 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-06-24 23:52:47 +0000 |
commit | c118f1a8166d1c612bed66ab64235cab6111a3cd (patch) | |
tree | 2a4e12d348f0c5f67d69d7974ae3481cbe24737a /Source/TableSource.m | |
parent | 15981eb3fbf5438de932c7b815707f3c6a7f0110 (diff) | |
download | sequelpro-c118f1a8166d1c612bed66ab64235cab6111a3cd.tar.gz sequelpro-c118f1a8166d1c612bed66ab64235cab6111a3cd.tar.bz2 sequelpro-c118f1a8166d1c612bed66ab64235cab6111a3cd.zip |
- Make changes to the table structure flush the appropriate table data caches
- SPTableData's columnWithName: now updates caches as necessary to avoid issues
- Mark the extended table info view (particularly the CREATE TABLE syntax) as requiring update following table structure changes
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r-- | Source/TableSource.m | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m index bd48b2ce..04441018 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -246,6 +246,8 @@ reloads the table (performing a new mysql-query) */ - (IBAction)reloadTable:(id)sender { + [tableDataInstance resetColumnData]; + [tablesListInstance setStatusRequiresReload:YES]; [self loadTable:selectedTable]; } @@ -346,6 +348,8 @@ reloads the table (performing a new mysql-query) [tempIndexedColumns componentsJoinedAndBacktickQuoted]]]; if ( [[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) { + [tableDataInstance resetColumnData]; + [tablesListInstance setStatusRequiresReload:YES]; [self loadTable:selectedTable]; [NSApp stopModalWithCode:1]; } else { @@ -784,11 +788,12 @@ fetches the result as an array with a dictionary for each row in it isEditingNewRow = NO; currentlyEditingRow = -1; + [tableDataInstance resetColumnData]; + [tablesListInstance setStatusRequiresReload:YES]; [self loadTable:selectedTable]; - // Mark the content table and column caches for refresh + // Mark the content table for refresh [tablesListInstance setContentRequiresReload:YES]; - [tableDataInstance resetColumnData]; return YES; } @@ -851,11 +856,12 @@ fetches the result as an array with a dictionary for each row in it [selectedTable backtickQuotedString], [[[tableFields objectAtIndex:[tableSourceView selectedRow]] objectForKey:@"Field"] backtickQuotedString]]]; if ( [[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) { + [tableDataInstance resetColumnData]; + [tablesListInstance setStatusRequiresReload:YES]; [self loadTable:selectedTable]; - // Mark the content table and column cache for refresh + // Mark the content table cache for refresh [tablesListInstance setContentRequiresReload:YES]; - [tableDataInstance resetColumnData]; } else { [self performSelector:@selector(showErrorSheetWith:) withObject:[NSArray arrayWithObjects:NSLocalizedString(@"Error", @"error"), @@ -877,6 +883,8 @@ fetches the result as an array with a dictionary for each row in it } if ( [[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) { + [tableDataInstance resetColumnData]; + [tablesListInstance setStatusRequiresReload:YES]; [self loadTable:selectedTable]; } else { [self performSelector:@selector(showErrorSheetWith:) @@ -1158,7 +1166,13 @@ would result in a position change. NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Couldn't move field. MySQL said: %@", @"message of panel when field cannot be added in drag&drop operation"), [mySQLConnection getLastErrorMessage]]); } else { + [tableDataInstance resetColumnData]; + [tablesListInstance setStatusRequiresReload:YES]; [self loadTable:selectedTable]; + + // Mark the content table cache for refresh + [tablesListInstance setContentRequiresReload:YES]; + if ( originalRowIndex < destinationRowIndex ) { [tableSourceView selectRow:destinationRowIndex-1 byExtendingSelection:NO]; } else { @@ -1167,10 +1181,6 @@ would result in a position change. } [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self]; - - // Mark the content table and column caches for refresh - [tablesListInstance setContentRequiresReload:YES]; - [tableDataInstance resetColumnData]; [originalRow release]; return YES; |