Skip to content

Commit 89fb7e7

Browse files
committed
Fix an issue with connection color and cloned connections
The red (first) connection color would not be duplicated to another tab, when choosing "Open Table in New X" from the context menu (issue reported by Kyle via e-mail).
1 parent 5f3c003 commit 89fb7e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/SPDatabaseDocument.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -4441,9 +4441,9 @@ - (NSDictionary *) stateIncludingDetails:(NSDictionary *)detailsToReturn
44414441
{
44424442
BOOL returnConnection = [[detailsToReturn objectForKey:@"connection"] boolValue];
44434443
BOOL includePasswords = [[detailsToReturn objectForKey:@"password"] boolValue];
4444-
BOOL returnSession = [[detailsToReturn objectForKey:@"session"] boolValue];
4445-
BOOL returnHistory = [[detailsToReturn objectForKey:@"history"] boolValue];
4446-
BOOL returnQuery = [[detailsToReturn objectForKey:@"query"] boolValue];
4444+
BOOL returnSession = [[detailsToReturn objectForKey:@"session"] boolValue];
4445+
BOOL returnHistory = [[detailsToReturn objectForKey:@"history"] boolValue];
4446+
BOOL returnQuery = [[detailsToReturn objectForKey:@"query"] boolValue];
44474447

44484448
if (!returnConnection && !returnSession && !returnHistory && !returnQuery) return nil;
44494449
NSMutableDictionary *stateDetails = [NSMutableDictionary dictionary];
@@ -4482,7 +4482,7 @@ - (NSDictionary *) stateIncludingDetails:(NSDictionary *)detailsToReturn
44824482
[connection setObject:[self name] forKey:@"name"];
44834483
[connection setObject:[self host] forKey:@"host"];
44844484
[connection setObject:[self user] forKey:@"user"];
4485-
if([connectionController colorIndex])
4485+
if([connectionController colorIndex] >= 0)
44864486
[connection setObject:[NSNumber numberWithInteger:[connectionController colorIndex]] forKey:SPFavoriteColorIndexKey];
44874487
if([connectionController port] && [[connectionController port] length])
44884488
[connection setObject:[NSNumber numberWithInteger:[[connectionController port] integerValue]] forKey:@"port"];

0 commit comments

Comments
 (0)