diff options
author | rowanbeentje <rowan@beent.je> | 2009-08-07 23:57:16 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-08-07 23:57:16 +0000 |
commit | 2297b13252ee7149606ecd4544898614f0ac9298 (patch) | |
tree | e9d704588859ba7b18a783f5ae214052d68fa8bf /Source/TableDocument.m | |
parent | 67a72bc3a598528f9d45010716df3554dd882241 (diff) | |
download | sequelpro-2297b13252ee7149606ecd4544898614f0ac9298.tar.gz sequelpro-2297b13252ee7149606ecd4544898614f0ac9298.tar.bz2 sequelpro-2297b13252ee7149606ecd4544898614f0ac9298.zip |
Merge in recent fixes from trunk for 0.9.6 release:
- r1145 (Custom Query completion fixes)
- r1148 (CSV file import reload bugfix)
- Parts of r1150 (history navigation no longer generates invalid states)
- r1172 (Add to favorites and favorites saving fixes)
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index eb2b6129..526ddae0 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -403,8 +403,12 @@ return; } - // Save existing scroll position and details - [spHistoryControllerInstance updateHistoryEntries]; + // Save existing scroll position and details, and ensure no duplicate entries are created as table list changes + BOOL historyStateChanging = [spHistoryControllerInstance modifyingHistoryState]; + if (!historyStateChanging) { + [spHistoryControllerInstance updateHistoryEntries]; + [spHistoryControllerInstance setModifyingHistoryState:YES]; + } // show error on connection failed if ( ![mySQLConnection selectDB:[chooseDatabaseButton titleOfSelectedItem]] ) { @@ -423,7 +427,10 @@ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", mySQLVersion, [self name], [self database]]]; // Add a history entry - [spHistoryControllerInstance updateHistoryEntries]; + if (!historyStateChanging) { + [spHistoryControllerInstance setModifyingHistoryState:NO]; + [spHistoryControllerInstance updateHistoryEntries]; + } } /** @@ -1371,9 +1378,9 @@ return [connectionController name]; } if ([connectionController type] == SP_CONNECTION_SOCKET) { - return [NSString stringWithFormat:@"%@@localhost", [connectionController user]?[connectionController user]:@""]; + return [NSString stringWithFormat:@"%@@localhost", ([connectionController user] && [[connectionController user] length])?[connectionController user]:@"anonymous"]; } - return [NSString stringWithFormat:@"%@@%@", [connectionController user]?[connectionController user]:@"", [connectionController host]?[connectionController host]:@""]; + return [NSString stringWithFormat:@"%@@%@", ([connectionController user] && [[connectionController user] length])?[connectionController user]:@"anonymous", [connectionController host]?[connectionController host]:@""]; } /** |