mirror of
https://github.com/TermiT/Flycut.git
synced 2025-02-20 22:13:14 +08:00
Move macOS code out of cross-platform files
This commit is contained in:
parent
c41711599e
commit
733897230d
2 changed files with 4 additions and 4 deletions
|
@ -858,7 +858,7 @@
|
|||
if (largeCopyRisk)
|
||||
[self toggleMenuIconDisabled];
|
||||
|
||||
if ( contents == nil || [flycutOperator shouldSkip:contents ofType:[jcPasteboard availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]]] ) {
|
||||
if ( contents == nil || [flycutOperator shouldSkip:contents ofType:[jcPasteboard availableTypeFromArray:[NSArray arrayWithObject:NSStringPboardType]] fromAvailableTypes:[jcPasteboard types]] ) {
|
||||
DLog(@"Contents: Empty or skipped");
|
||||
} else if ( ! [pbCount isEqualTo:pbBlockCount] ) {
|
||||
[flycutOperator addClipping:contents ofType:type fromApp:[currRunningApp localizedName] withAppBundleURL:currRunningApp.bundleURL.path target:self clippingAddedSelector:@selector(updateMenu)];
|
||||
|
|
|
@ -303,7 +303,7 @@
|
|||
return [self clippingStringWithCount:indexInt];
|
||||
}
|
||||
|
||||
-(BOOL)shouldSkip:(NSString *)contents ofType:(NSString *)type
|
||||
-(BOOL)shouldSkip:(NSString *)contents ofType:(NSString *)type fromAvailableTypes:(NSArray<NSString *> *)availableTypes
|
||||
{
|
||||
// Check to see if we are skipping passwords based on length and characters.
|
||||
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPasswordFields"] )
|
||||
|
@ -316,10 +316,10 @@
|
|||
__block bool skipClipping = NO;
|
||||
|
||||
// Check the array of types to skip.
|
||||
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPboardTypes"] )
|
||||
if ( availableTypes && [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPboardTypes"] )
|
||||
{
|
||||
NSSet *typesToSkip = [NSSet setWithArray: [[[[NSUserDefaults standardUserDefaults] stringForKey:@"skipPboardTypesList"] stringByReplacingOccurrencesOfString:@" " withString:@""] componentsSeparatedByString: @","]];
|
||||
NSSet *pasteBoardTypes = [NSSet setWithArray: [[NSPasteboard generalPasteboard] types]];
|
||||
NSSet *pasteBoardTypes = [NSSet setWithArray: availableTypes];
|
||||
|
||||
if ( [pasteBoardTypes intersectsSet: typesToSkip] )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue