From e587cd65fda5edba4749831db705cd590003c085 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Thu, 12 Jul 2018 22:54:54 +0200 Subject: [PATCH] moder Objective-C --- MacPass/MPEntryInspectorViewController.m | 2 +- MacPass/MPEntryViewController.m | 8 ++++---- MacPass/MPLockDaemon.h | 2 +- MacPass/MPPasteBoardController.h | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index 55e14d76..9b5ad899 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -604,7 +604,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { name = [_customFieldsController.arrangedObjects[index] key]; } } - [[MPPasteBoardController defaultController] copyObjects:@[value] overlayInfo:info name:name atView:self.view]; + [MPPasteBoardController.defaultController copyObjects:@[value] overlayInfo:info name:name atView:self.view]; return NO; } return YES; diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index f932fe5b..2cebbeac 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -624,7 +624,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil; NSString *value = [selectedEntry.password kpk_finalValueForEntry:selectedEntry]; if(value) { - [[MPPasteBoardController defaultController] copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoPassword name:nil atView:self.view]; + [MPPasteBoardController.defaultController copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoPassword name:nil atView:self.view]; } } @@ -633,7 +633,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil; NSString *value = [selectedEntry.username kpk_finalValueForEntry:selectedEntry]; if(value) { - [[MPPasteBoardController defaultController] copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoUsername name:nil atView:self.view]; + [MPPasteBoardController.defaultController copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoUsername name:nil atView:self.view]; } } @@ -646,7 +646,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; KPKAttribute *attribute = selectedEntry.customAttributes[index]; NSString *value = attribute.evaluatedValue; if(value) { - [[MPPasteBoardController defaultController] copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoCustom name:attribute.key atView:self.view]; + [MPPasteBoardController.defaultController copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoCustom name:attribute.key atView:self.view]; } } } @@ -656,7 +656,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil; NSString *value = [selectedEntry.url kpk_finalValueForEntry:selectedEntry]; if(value) { - [[MPPasteBoardController defaultController] copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoURL name:nil atView:self.view]; + [MPPasteBoardController.defaultController copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoURL name:nil atView:self.view]; } } diff --git a/MacPass/MPLockDaemon.h b/MacPass/MPLockDaemon.h index 3a57e278..eb731759 100644 --- a/MacPass/MPLockDaemon.h +++ b/MacPass/MPLockDaemon.h @@ -24,7 +24,7 @@ @interface MPLockDaemon : NSObject -+ (instancetype)defaultDaemon; +@property (class, strong, readonly) MPLockDaemon *defaultDaemon; + (instancetype)init NS_UNAVAILABLE; @end diff --git a/MacPass/MPPasteBoardController.h b/MacPass/MPPasteBoardController.h index 4faa738b..89b5231c 100644 --- a/MacPass/MPPasteBoardController.h +++ b/MacPass/MPPasteBoardController.h @@ -50,8 +50,7 @@ FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidClearClipboard; * If set to YES, MacPass will clear the pastboard when it quits. */ @property (assign, nonatomic) BOOL clearPasteboardOnShutdown; - -+ (MPPasteBoardController *)defaultController; +@property (class, strong, readonly) MPPasteBoardController *defaultController; - (void)stashObjects; - (void)restoreObjects;