mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
fixed issue with wrong clear timeout when pasting was done inside the clear timeout
This commit is contained in:
@@ -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;
|
||||
|
||||
13
MacPass/MPPluginConstants.h
Normal file
13
MacPass/MPPluginConstants.h
Normal file
@@ -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 */
|
||||
9
MacPass/MPPluginConstants.m
Normal file
9
MacPass/MPPluginConstants.m
Normal file
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// MPPluginConstants.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 29.11.17.
|
||||
// Copyright © 2017 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
Reference in New Issue
Block a user