aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPConnectionController.m13
-rw-r--r--Source/SPConnectionHandler.m13
-rw-r--r--Source/SPPreferencesUpgrade.m4
-rw-r--r--Source/SPTextView.m6
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]