From aeeca850c24ce9fefdfaf66fc0a311e920982690 Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 29 Aug 2017 14:58:13 +0200 Subject: [PATCH] using class properties where possible --- MacPass/MPPasteBoardController.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MacPass/MPPasteBoardController.m b/MacPass/MPPasteBoardController.m index 800e38d9..cad358ad 100644 --- a/MacPass/MPPasteBoardController.m +++ b/MacPass/MPPasteBoardController.m @@ -43,16 +43,16 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas - (void)dealloc { if(_clearPasteboardOnShutdown) { - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [NSNotificationCenter.defaultCenter removeObserver:self]; } } - (void)_updateNotifications { if(self.clearPasteboardOnShutdown) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_clearPasteboardContents) name:NSApplicationWillTerminateNotification object:nil]; + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_clearPasteboardContents) name:NSApplicationWillTerminateNotification object:nil]; } else { - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [NSNotificationCenter.defaultCenter removeObserver:self]; } } @@ -89,7 +89,7 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas - (void)copyObjects:(NSArray *)objects { [self copyObjectsWithoutTimeout:objects]; if(self.clearTimeout != 0) { - [[NSNotificationCenter defaultCenter] postNotificationName:MPPasteBoardControllerDidCopyObjects object:self]; + [NSNotificationCenter.defaultCenter postNotificationName:MPPasteBoardControllerDidCopyObjects object:self]; [self performSelector:@selector(_clearPasteboardContents) withObject:nil afterDelay:self.clearTimeout]; } } @@ -105,7 +105,7 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas /* Only clear stuff we might have put there */ if(!self.isEmpty) { [[NSPasteboard generalPasteboard] clearContents]; - [[NSNotificationCenter defaultCenter] postNotificationName:MPPasteBoardControllerDidClearClipboard object:self]; + [NSNotificationCenter.defaultCenter postNotificationName:MPPasteBoardControllerDidClearClipboard object:self]; } self.isEmpty = YES; }