@@ -48,11 +48,11 @@ - (void)willQueryString:(NSString *)query connection:(id)connection
4848{
4949#ifndef SP_CODA
5050 if ([prefs boolForKey: SPConsoleEnableLogging]) {
51- if ((_queryMode == SPInterfaceQueryMode && [prefs boolForKey: SPConsoleEnableInterfaceLogging])
52- || (_queryMode == SPCustomQueryQueryMode && [prefs boolForKey: SPConsoleEnableCustomQueryLogging])
53- || (_queryMode == SPImportExportQueryMode && [prefs boolForKey: SPConsoleEnableImportExportLogging]))
51+ if ((_queryMode == SPInterfaceQueryMode && [prefs boolForKey: SPConsoleEnableInterfaceLogging]) ||
52+ (_queryMode == SPCustomQueryQueryMode && [prefs boolForKey: SPConsoleEnableCustomQueryLogging]) ||
53+ (_queryMode == SPImportExportQueryMode && [prefs boolForKey: SPConsoleEnableImportExportLogging]))
5454 {
55- [[SPQueryController sharedQueryController ] showMessageInConsole: query connection: [self name ]];
55+ [[SPQueryController sharedQueryController ] showMessageInConsole: query connection: [self name ] database: [ self database ] ];
5656 }
5757 }
5858#endif
@@ -65,7 +65,7 @@ - (void)queryGaveError:(NSString *)error connection:(id)connection
6565{
6666#ifndef SP_CODA
6767 if ([prefs boolForKey: SPConsoleEnableLogging] && [prefs boolForKey: SPConsoleEnableErrorLogging]) {
68- [[SPQueryController sharedQueryController ] showErrorInConsole: error connection: [self name ]];
68+ [[SPQueryController sharedQueryController ] showErrorInConsole: error connection: [self name ] database: [ self database ] ];
6969 }
7070#endif
7171}
@@ -75,7 +75,6 @@ - (void)queryGaveError:(NSString *)error connection:(id)connection
7575 */
7676- (NSString *)keychainPasswordForConnection : (SPMySQLConnection *)connection
7777{
78-
7978 // If no keychain item is available, return an empty password
8079 if (![connectionController connectionKeychainItemName ]) return nil ;
8180
@@ -96,23 +95,26 @@ - (NSString *)keychainPasswordForConnection:(SPMySQLConnection *)connection
9695 */
9796- (NSString *)keychainPasswordForSSHConnection : (SPMySQLConnection *)connection
9897{
99-
10098 // If no keychain item is available, return an empty password
10199 if (![connectionController connectionKeychainItemName ]) return @" " ;
102100
103101 // Otherwise, pull the password from the keychain using the details from this connection
104102 SPKeychain *keychain = [[SPKeychain alloc ] init ];
103+
105104 NSString *connectionSSHKeychainItemName = [[keychain nameForSSHForFavoriteName: [connectionController name ] id: [self keyChainID ]] retain ];
106105 NSString *connectionSSHKeychainItemAccount = [[keychain accountForSSHUser: [connectionController sshUser ] sshHost: [connectionController sshHost ]] retain ];
107- NSString *sshpw = [keychain getPasswordForName: connectionSSHKeychainItemName account: connectionSSHKeychainItemAccount];
108- if (!sshpw || ![sshpw length ])
109- sshpw = @" " ;
106+ NSString *sshPassword = [keychain getPasswordForName: connectionSSHKeychainItemName account: connectionSSHKeychainItemAccount];
107+
108+ if (!sshPassword || ![sshPassword length ]) {
109+ sshPassword = @" " ;
110+ }
111+
112+ if (connectionSSHKeychainItemName) [connectionSSHKeychainItemName release ];
113+ if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release ];
110114
111- if (connectionSSHKeychainItemName) [connectionSSHKeychainItemName release ];
112- if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release ];
113115 [keychain release ];
114116
115- return sshpw ;
117+ return sshPassword ;
116118}
117119
118120/* *
@@ -121,7 +123,17 @@ - (NSString *)keychainPasswordForSSHConnection:(SPMySQLConnection *)connection
121123 */
122124- (void )noConnectionAvailable : (id )connection
123125{
124- SPBeginAlertSheet (NSLocalizedString(@" No connection available" , @" no connection available message" ), NSLocalizedString(@" OK" , @" OK button" ), nil , nil , [self parentWindow ], self, nil , nil , NSLocalizedString(@" An error has occured and there doesn't seem to be a connection available." , @" no connection available informatie message" ));
126+ SPBeginAlertSheet (
127+ NSLocalizedString (@" No connection available" , @" no connection available message" ),
128+ NSLocalizedString(@" OK" , @" OK button" ),
129+ nil,
130+ nil,
131+ [self parentWindow],
132+ self,
133+ nil,
134+ nil,
135+ NSLocalizedString(@" An error has occured and there doesn't seem to be a connection available." , @" no connection available informatie message" )
136+ );
125137}
126138
127139/* *
0 commit comments