diff --git a/MacPass/MPPasteBoardController.m b/MacPass/MPPasteBoardController.m index 2b0a44d0..38b33123 100644 --- a/MacPass/MPPasteBoardController.m +++ b/MacPass/MPPasteBoardController.m @@ -96,6 +96,9 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas [self copyObjectsWithoutTimeout:objects]; if(self.clearTimeout != 0) { [NSNotificationCenter.defaultCenter postNotificationName:MPPasteBoardControllerDidCopyObjects object:self]; + /* cancel old timer */ + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_clearPasteboardContents) object:nil]; + /* setup new timer */ [self performSelector:@selector(_clearPasteboardContents) withObject:nil afterDelay:self.clearTimeout]; } } @@ -140,7 +143,7 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas - (void)_clearPasteboardContents { /* Only clear stuff we might have put there */ if(!self.isEmpty) { - [[NSPasteboard generalPasteboard] clearContents]; + [NSPasteboard.generalPasteboard clearContents]; [NSNotificationCenter.defaultCenter postNotificationName:MPPasteBoardControllerDidClearClipboard object:self]; } self.isEmpty = YES; diff --git a/MacPass/MPPluginConstants.h b/MacPass/MPPluginConstants.h new file mode 100644 index 00000000..a53b8a4f --- /dev/null +++ b/MacPass/MPPluginConstants.h @@ -0,0 +1,13 @@ +// +// MPPluginConstants.h +// MacPass +// +// Created by Michael Starke on 29.11.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#ifndef MPPluginConstants_h +#define MPPluginConstants_h + + +#endif /* MPPluginConstants_h */ diff --git a/MacPass/MPPluginConstants.m b/MacPass/MPPluginConstants.m new file mode 100644 index 00000000..782d838f --- /dev/null +++ b/MacPass/MPPluginConstants.m @@ -0,0 +1,9 @@ +// +// MPPluginConstants.m +// MacPass +// +// Created by Michael Starke on 29.11.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import