Skip clipping based on full set of pasteboard typesCheck types to skip against the full list of pasteboard typesAdd common types from nspasteboard.org as defaults

This commit is contained in:
Juhani Pelli 2016-10-16 13:57:35 +01:00
parent c7654e03cd
commit fdfa5005fc

View file

@ -33,7 +33,7 @@
@"skipPasswordFields",
[NSNumber numberWithBool:YES],
@"skipPboardTypes",
@"PasswordPboardType",
@"PasswordPboardType,org.nspasteboard.TransientType,org.nspasteboard.ConcealedType,org.nspasteboard.AutoGeneratedType,com.agilebits.onepassword",
@"skipPboardTypesList",
[NSNumber numberWithBool:NO],
@"skipPasswordLengths",
@ -318,15 +318,14 @@
// Check the array of types to skip.
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPboardTypes"] )
{
NSArray *typesArray = [[[[NSUserDefaults standardUserDefaults] stringForKey:@"skipPboardTypesList"] stringByReplacingOccurrencesOfString:@" " withString:@""] componentsSeparatedByString: @","];
[typesArray enumerateObjectsUsingBlock:^(id typeString, NSUInteger idx, BOOL *stop)
{
if ( [type isEqualToString:typeString] )
NSSet *typesToSkip = [NSSet setWithArray: [[[[NSUserDefaults standardUserDefaults] stringForKey:@"skipPboardTypesList"] stringByReplacingOccurrencesOfString:@" " withString:@""] componentsSeparatedByString: @","]];
NSSet *pasteBoardTypes = [NSSet setWithArray: [[NSPasteboard generalPasteboard] types]];
if ( [pasteBoardTypes intersectsSet: typesToSkip] )
{
skipClipping = YES;
*stop = YES;
}
}];
};
}
if (skipClipping)
return YES;