Moved defaults to else branches

This commit is contained in:
Gregory John Casamento 2020-05-07 17:53:40 -04:00
parent b8e551c6ac
commit 5fcbc9e46c

View file

@ -460,20 +460,26 @@ static Class pathCellClass;
{
if ([coder allowsKeyedCoding])
{
// Defaults for some values which aren't encoded unless they are non-default.
[self setBackgroundColor: [NSColor windowBackgroundColor]];
[self setAllowedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]];
if ([coder containsValueForKey: @"NSBackgroundColor"])
{
[self setBackgroundColor: [coder decodeObjectForKey: @"NSBackgroundColor"]];
}
else
{
[self setBackgroundColor: [NSColor windowBackgroundColor]];
}
if ([coder containsValueForKey: @"NSDragTypes"])
{
[self setAllowedTypes: [coder decodeObjectForKey: @"NSDragTypes"]];
}
else
{
[self setAllowedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]];
}
if ([coder containsValueForKey: @"NSControlAction"])
{
NSString *s = [coder decodeObjectForKey: @"NSControlAction"];