diff options
author | Max <post@wickenrode.com> | 2015-02-14 21:45:08 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-02-14 21:45:08 +0100 |
commit | fa28b26e418f6f5c2f47ec78f9b7ef4910155b96 (patch) | |
tree | fae4e9fd8b58e88fc89566bd15a5ddc4cf6396c4 /Source/SPSSHTunnel.m | |
parent | b1e32f6583f113c279dcde61f4f531d637118bdd (diff) | |
download | sequelpro-fa28b26e418f6f5c2f47ec78f9b7ef4910155b96.tar.gz sequelpro-fa28b26e418f6f5c2f47ec78f9b7ef4910155b96.tar.bz2 sequelpro-fa28b26e418f6f5c2f47ec78f9b7ef4910155b96.zip |
Move some duplicate code into a new class
(This also affects PSMSequelProTabStyle, but see the comment there why it is left unchanged)
Diffstat (limited to 'Source/SPSSHTunnel.m')
-rw-r--r-- | Source/SPSSHTunnel.m | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 3b58d331..e09d0ce2 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -35,6 +35,7 @@ #import "SPKeychain.h" #import "SPAlertSheets.h" #import "SPThreadAdditions.h" +#import "SPOSInfo.h" #import <netinet/in.h> #import <CommonCrypto/CommonDigest.h> @@ -55,8 +56,7 @@ if (!theHost || !targetPort || !targetHost) return nil; if ((self = [super init])) { - SInt32 systemVersion = 0; - Gestalt(gestaltSystemVersion, &systemVersion); + BOOL isOSVersionAtLeast10_7_0 = [SPOSInfo isOSVersionAtLeastMajor:10 minor:7 patch:0]; // Store the connection settings as appropriate sshHost = [[NSString alloc] initWithString:theHost]; @@ -74,7 +74,7 @@ // Enable connection muxing on 10.7+, but only if a preference is enabled; this is because // muxing causes connection instability for a large number of users (see Issue #1457) - connectionMuxingEnabled = (systemVersion >= 0x1070) && [[NSUserDefaults standardUserDefaults] boolForKey:SPSSHEnableMuxingPreference]; + connectionMuxingEnabled = isOSVersionAtLeast10_7_0 && [[NSUserDefaults standardUserDefaults] boolForKey:SPSSHEnableMuxingPreference]; // Set up a connection for use by the tunnel process tunnelConnectionName = [[NSString alloc] initWithFormat:@"SequelPro-%lu", (unsigned long)[[NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]] hash]]; |