aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSSHTunnel.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-10-17 00:35:09 +0000
committerstuconnolly <stuart02@gmail.com>2009-10-17 00:35:09 +0000
commit6a4e2994d17220eb43015162522deec1efdd429b (patch)
treef1d2abc0691948bcbd901929c82347137ee0de85 /Source/SPSSHTunnel.m
parentc3eb7de88f2baf7774749f4311a84b75ef833eb7 (diff)
downloadsequelpro-6a4e2994d17220eb43015162522deec1efdd429b.tar.gz
sequelpro-6a4e2994d17220eb43015162522deec1efdd429b.tar.bz2
sequelpro-6a4e2994d17220eb43015162522deec1efdd429b.zip
Replace the use of hard coded preference keys with constants to prevent issues such as the one fixed in revision 1419. All future preference usage should be done so using these constants.
Diffstat (limited to 'Source/SPSSHTunnel.m')
-rw-r--r--Source/SPSSHTunnel.m10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m
index 843acb89..d6a5756f 100644
--- a/Source/SPSSHTunnel.m
+++ b/Source/SPSSHTunnel.m
@@ -26,6 +26,8 @@
#import "SPSSHTunnel.h"
#import "RegexKitLite.h"
#import "SPKeychain.h"
+#import "SPConstants.h"
+
#import <netinet/in.h>
@implementation SPSSHTunnel
@@ -193,10 +195,10 @@
return;
}
- int connectionTimeout = [[[NSUserDefaults standardUserDefaults] objectForKey:@"ConnectionTimeoutValue"] intValue];
+ int connectionTimeout = [[[NSUserDefaults standardUserDefaults] objectForKey:SPConnectionTimeoutValue] intValue];
if (!connectionTimeout) connectionTimeout = 10;
- BOOL useKeepAlive = [[[NSUserDefaults standardUserDefaults] objectForKey:@"UseKeepAlive"] doubleValue];
- double keepAliveInterval = [[[NSUserDefaults standardUserDefaults] objectForKey:@"KeepAliveInterval"] doubleValue];
+ BOOL useKeepAlive = [[[NSUserDefaults standardUserDefaults] objectForKey:SPUseKeepAlive] doubleValue];
+ double keepAliveInterval = [[[NSUserDefaults standardUserDefaults] objectForKey:SPKeepAliveInterval] doubleValue];
if (!keepAliveInterval) keepAliveInterval = 0;
// If no local port has yet been chosen, choose one
@@ -415,7 +417,7 @@
connectionState = PROXY_STATE_IDLE;
[task terminate];
if (lastError) [lastError release];
- lastError = [[NSString alloc] initWithFormat:NSLocalizedString(@"The SSH Tunnel was unable to connect to host %@, or the request timed out.\n\nBe sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently %i seconds).", @"SSH tunnel failed or timed out message"), sshHost, [[[NSUserDefaults standardUserDefaults] objectForKey:@"ConnectionTimeoutValue"] intValue]];
+ lastError = [[NSString alloc] initWithFormat:NSLocalizedString(@"The SSH Tunnel was unable to connect to host %@, or the request timed out.\n\nBe sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently %i seconds).", @"SSH tunnel failed or timed out message"), sshHost, [[[NSUserDefaults standardUserDefaults] objectForKey:SPConnectionTimeoutValue] intValue]];
if (delegate) [delegate performSelectorOnMainThread:stateChangeSelector withObject:self waitUntilDone:NO];
}
}