Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,9 @@ - (void)pasteFromStack
NSLog(@"pasteFromStack called");
NSString *content = [flycutOperator getPasteFromStackPosition];
if ( nil != content ) {
NSLog(@"Content found, adding to pasteboard and preparing to paste: %@", [content substringToIndex:MIN(content.length, 50)]);
// Never log clipping contents; NSLog output lands in the unified log, which
// other processes and diagnostics can read.
NSLog(@"Content found, adding to pasteboard and preparing to paste");
[self addClipToPasteboard:content];
[self performSelector:@selector(hideApp) withObject:nil afterDelay:0.2];
[self performSelector:@selector(fakeCommandV) withObject:nil afterDelay:0.5];
Expand Down Expand Up @@ -1418,11 +1420,11 @@ - (IBAction)setSavePreference:(id)sender

if ( [alert runModal] == NSAlertFirstButtonReturn )
{
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:NO]];
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:NO] forKey:@"syncClippingsViaICloud"];
}
else
{
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:2]];
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:2] forKey:@"savePreference"];
}
[alert release];
}
Expand Down
40 changes: 22 additions & 18 deletions FlycutOperator.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,31 +362,35 @@ -(NSString*)getClipFromCount:(int)indexInt

-(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"] )
// Check to see if they want a little help figuring out what types to enter.
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"revealPasteboardTypes"] )
{
// Check to see if they want a little help figuring out what types to enter.
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"revealPasteboardTypes"] )
[clippingStore addClipping:type ofType:type fromAppLocalizedName:@"Flycut" fromAppBundleURL:nil atTimestamp:0];
[clippingStore addClipping:type ofType:type fromAppLocalizedName:@"Flycut" fromAppBundleURL:nil atTimestamp:0];
[self actionAfterListModification];
}

__block bool skipClipping = NO;
__block bool skipClipping = NO;

// Check the array of types to skip.
if ( availableTypes && [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPboardTypes"] )
{
NSSet *typesToSkip = [NSSet setWithArray: [[[[NSUserDefaults standardUserDefaults] stringForKey:@"skipPboardTypesList"] stringByReplacingOccurrencesOfString:@" " withString:@""] componentsSeparatedByString: @","]];
NSSet *pasteBoardTypes = [NSSet setWithArray: availableTypes];
// Check the array of types to skip. This honors the nspasteboard.org conventions
// (ConcealedType etc.), so it must apply independently of the password-field
// heuristics toggle below.
if ( availableTypes && [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPboardTypes"] )
{
NSSet *typesToSkip = [NSSet setWithArray: [[[[NSUserDefaults standardUserDefaults] stringForKey:@"skipPboardTypesList"] stringByReplacingOccurrencesOfString:@" " withString:@""] componentsSeparatedByString: @","]];
NSSet *pasteBoardTypes = [NSSet setWithArray: availableTypes];

if ( [pasteBoardTypes intersectsSet: typesToSkip] )
{
skipClipping = YES;
};
if ( [pasteBoardTypes intersectsSet: typesToSkip] )
{
skipClipping = YES;
};

}
if (skipClipping)
return YES;
}
if (skipClipping)
return YES;

// Check to see if we are skipping passwords based on length and characters.
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPasswordFields"] )
{
// Check the array of lengths to skip for suspicious strings.
if ( [[NSUserDefaults standardUserDefaults] boolForKey:@"skipPasswordLengths"] )
{
Expand Down