diff options
author | rowanbeentje <rowan@beent.je> | 2013-02-13 00:02:42 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-02-13 00:02:42 +0000 |
commit | c37936d71c9c8ad9b721e33899bb118032466896 (patch) | |
tree | 57e6a4e012d148367278821a9902897e8cb0686e /Source | |
parent | 4be04fd8fd3035dd77d44851d9470d8328a3af74 (diff) | |
parent | 3a440aa512f3524545dc0b1ec39362d052ed4806 (diff) | |
download | sequelpro-c37936d71c9c8ad9b721e33899bb118032466896.tar.gz sequelpro-c37936d71c9c8ad9b721e33899bb118032466896.tar.bz2 sequelpro-c37936d71c9c8ad9b721e33899bb118032466896.zip |
- Merge in changes from 1.0.x release branch to trunk
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConnectionController.m | 13 | ||||
-rw-r--r-- | Source/SPConnectionHandler.m | 13 | ||||
-rw-r--r-- | Source/SPPreferencesUpgrade.m | 4 | ||||
-rw-r--r-- | Source/SPTextView.m | 6 |
4 files changed, 20 insertions, 16 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 52cb75bc..752c0c00 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -363,7 +363,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, { NSString *directoryPath = nil; NSString *filePath = nil; - NSArray *permittedFileTypes = nil; keySelectionPanel = [NSOpenPanel openPanel]; [keySelectionPanel setShowsHiddenFiles:[prefs boolForKey:SPHiddenKeyFileVisibilityKey]]; @@ -388,8 +387,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, directoryPath = [sshKeyLocation stringByDeletingLastPathComponent]; } - permittedFileTypes = [NSArray arrayWithObjects:@"pem", @"key", @"", nil]; - [keySelectionPanel setAccessoryView:sshKeyLocationHelp]; } // SSL key file location: @@ -399,8 +396,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, return; } - permittedFileTypes = [NSArray arrayWithObjects:@"pem", @"key", @"", nil]; - [keySelectionPanel setAccessoryView:sslKeyFileLocationHelp]; } // SSL certificate file location: @@ -409,9 +404,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, [self setSslCertificateFileLocation:nil]; return; } - - permittedFileTypes = [NSArray arrayWithObjects:@"pem", @"cert", @"crt", @"", nil]; - + [keySelectionPanel setAccessoryView:sslCertificateLocationHelp]; } // SSL CA certificate file location: @@ -421,14 +414,12 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, return; } - permittedFileTypes = [NSArray arrayWithObjects:@"pem", @"cert", @"crt", @"", nil]; - [keySelectionPanel setAccessoryView:sslCACertLocationHelp]; } [keySelectionPanel beginSheetForDirectory:directoryPath file:filePath - types:permittedFileTypes + types:nil modalForWindow:[dbDocument parentWindow] modalDelegate:self didEndSelector:@selector(chooseKeyLocationSheetDidEnd:returnCode:contextInfo:) diff --git a/Source/SPConnectionHandler.m b/Source/SPConnectionHandler.m index 0bbd4409..29c6e8fe 100644 --- a/Source/SPConnectionHandler.m +++ b/Source/SPConnectionHandler.m @@ -46,10 +46,17 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; @interface SPConnectionController () - (void)_restoreConnectionInterface; + +@end + +@interface SPConnectionController (SPConnectionHandlerPrivateAPI) + - (void)_showConnectionTestResult:(NSString *)resultString; @end +#pragma mark - + @implementation SPConnectionController (SPConnectionHandler) /** @@ -493,6 +500,12 @@ static NSString *SPLocalhostAddress = @"127.0.0.1"; } } +@end + +#pragma mark - + +@implementation SPConnectionController (SPConnectionHandlerPrivateAPI) + /** * Display a connection test error or success message */ diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index fad33e7c..77af6b0a 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -375,11 +375,11 @@ void SPMigrateConnectionFavoritesData(void) NSInteger lastFavoriteIndex = [prefs integerForKey:@"LastFavoriteIndex"]; NSInteger defaultFavoriteIndex = [prefs integerForKey:SPDefaultFavorite]; - if ((lastFavoriteIndex >= (NSInteger)0) && ((NSUInteger)lastFavoriteIndex <= [favorites count])) { + if ((lastFavoriteIndex >= (NSInteger)0) && ((NSUInteger)lastFavoriteIndex < [favorites count])) { [prefs setInteger:[[[favorites objectAtIndex:lastFavoriteIndex] objectForKey:SPFavoriteIDKey] integerValue] forKey:SPLastFavoriteID]; } - if ((defaultFavoriteIndex >= (NSInteger)0) && ((NSUInteger)defaultFavoriteIndex <= [favorites count])) { + if ((defaultFavoriteIndex >= (NSInteger)0) && ((NSUInteger)defaultFavoriteIndex < [favorites count])) { [prefs setInteger:[[[favorites objectAtIndex:defaultFavoriteIndex] objectForKey:SPFavoriteIDKey] integerValue] forKey:SPDefaultFavorite]; } diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 39398a46..9a29460e 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -1476,7 +1476,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys: field, @"display", @"field-small-square", @"image", - [NSString stringWithFormat:@"%@@%%@",currentTable,currentDb], @"path", SPUniqueSchemaDelimiter, + [NSString stringWithFormat:@"%@%@%@", currentTable, SPUniqueSchemaDelimiter, currentDb], @"path", t, @"type", lst, @"list", @"", @"isRef", @@ -1485,7 +1485,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS [possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys: field, @"display", @"field-small-square", @"image", - [NSString stringWithFormat:@"%@%@%@",currentTable,currentDb], @"path", SPUniqueSchemaDelimiter, + [NSString stringWithFormat:@"%@%@%@", currentTable, SPUniqueSchemaDelimiter, currentDb], @"path", typ, @"type", @"", @"isRef", nil]]; @@ -3240,7 +3240,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS NSUInteger currentSelectionLength = [self selectedRange].length; // If selection started/ended, redraw the background in the current query area - if ([self shouldHiliteQuery] && (currentSelectionLength && !proposedSelRange.length) || (!currentSelectionLength && proposedSelRange.length)) { + if ([self shouldHiliteQuery] && ((currentSelectionLength && !proposedSelRange.length) || (!currentSelectionLength && proposedSelRange.length))) { NSUInteger i = 0, rectCount = 0; NSRect* rectsToUpdate = [[self layoutManager] rectArrayForCharacterRange:[self queryRange] withinSelectedCharacterRange:[self queryRange] |