mirror of
https://github.com/TermiT/Flycut.git
synced 2024-11-10 09:32:29 +08:00
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:
parent
c7654e03cd
commit
fdfa5005fc
1 changed files with 8 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue