aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldMapperController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-06-14 00:19:01 +0000
committerrowanbeentje <rowan@beent.je>2011-06-14 00:19:01 +0000
commitb4b81b2dd07674b7dc3208e3b79690f66b1bf113 (patch)
tree712709715094c00668e681e83d0ce91cfb061d26 /Source/SPFieldMapperController.m
parent876a4e359f72653a4be001b5bb41900253794b58 (diff)
downloadsequelpro-b4b81b2dd07674b7dc3208e3b79690f66b1bf113.tar.gz
sequelpro-b4b81b2dd07674b7dc3208e3b79690f66b1bf113.tar.bz2
sequelpro-b4b81b2dd07674b7dc3208e3b79690f66b1bf113.zip
- Fix "Multiple selection" still being displayed after multiple tables are deleted
- If multiple tables are selected when opening the SPFieldMapperController select the first to import into - Clean up tableName in tablesList - now returns nil if no tables are selected or multiple tables are selected, instead of returning an empty string for multiple tables
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r--Source/SPFieldMapperController.m14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index ae76f8e2..6a558321 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -144,10 +144,9 @@ static NSString *SPTableViewSqlColumnID = @"sql";
[tableTargetPopup addItemsWithTitles:allTableNames];
// Select either the currently selected table, or the first item in the list, or if no table in db switch to "New Table" mode
- if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil
- && ![[tablesListInstance tableName] isEqualToString:@""]
- && [allTableNames containsObject:[tablesListInstance tableName]]) {
- [tableTargetPopup selectItemWithTitle:[tablesListInstance tableName]];
+ if ([[tablesListInstance selectedTableNames] count]
+ && [allTableNames containsObject:[[tablesListInstance selectedTableNames] objectAtIndex:0]]) {
+ [tableTargetPopup selectItemWithTitle:[[tablesListInstance selectedTableNames] objectAtIndex:0]];
} else {
if([allTableNames count])
[tableTargetPopup selectItemAtIndex:3];
@@ -514,10 +513,9 @@ static NSString *SPTableViewSqlColumnID = @"sql";
}
// Select either the currently selected table, or the first item in the list, or if no table in db switch to "New Table" mode
- if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil
- && ![[tablesListInstance tableName] isEqualToString:@""]
- && [allTableNames containsObject:[tablesListInstance tableName]]) {
- [tableTargetPopup selectItemWithTitle:[tablesListInstance tableName]];
+ if ([[tablesListInstance selectedTableNames] count]
+ && [allTableNames containsObject:[[tablesListInstance selectedTableNames] objectAtIndex:0]]) {
+ [tableTargetPopup selectItemWithTitle:[[tablesListInstance selectedTableNames] objectAtIndex:0]];
} else {
if([allTableNames count])
[tableTargetPopup selectItemAtIndex:3];