moder Objective-C

This commit is contained in:
Michael Starke
2018-07-12 22:54:54 +02:00
parent 274a58b789
commit e587cd65fd
4 changed files with 7 additions and 8 deletions

View File

@@ -604,7 +604,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
name = [_customFieldsController.arrangedObjects[index] key]; 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 NO;
} }
return YES; return YES;

View File

@@ -624,7 +624,7 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil; KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil;
NSString *value = [selectedEntry.password kpk_finalValueForEntry:selectedEntry]; NSString *value = [selectedEntry.password kpk_finalValueForEntry:selectedEntry];
if(value) { 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; KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil;
NSString *value = [selectedEntry.username kpk_finalValueForEntry:selectedEntry]; NSString *value = [selectedEntry.username kpk_finalValueForEntry:selectedEntry];
if(value) { 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]; KPKAttribute *attribute = selectedEntry.customAttributes[index];
NSString *value = attribute.evaluatedValue; NSString *value = attribute.evaluatedValue;
if(value) { 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; KPKEntry *selectedEntry = nodes.count == 1 ? [nodes.firstObject asEntry] : nil;
NSString *value = [selectedEntry.url kpk_finalValueForEntry:selectedEntry]; NSString *value = [selectedEntry.url kpk_finalValueForEntry:selectedEntry];
if(value) { if(value) {
[[MPPasteBoardController defaultController] copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoURL name:nil atView:self.view]; [MPPasteBoardController.defaultController copyObjects:@[value] overlayInfo:MPPasteboardOverlayInfoURL name:nil atView:self.view];
} }
} }

View File

@@ -24,7 +24,7 @@
@interface MPLockDaemon : NSObject @interface MPLockDaemon : NSObject
+ (instancetype)defaultDaemon; @property (class, strong, readonly) MPLockDaemon *defaultDaemon;
+ (instancetype)init NS_UNAVAILABLE; + (instancetype)init NS_UNAVAILABLE;
@end @end

View File

@@ -50,8 +50,7 @@ FOUNDATION_EXPORT NSString *const MPPasteBoardControllerDidClearClipboard;
* If set to YES, MacPass will clear the pastboard when it quits. * If set to YES, MacPass will clear the pastboard when it quits.
*/ */
@property (assign, nonatomic) BOOL clearPasteboardOnShutdown; @property (assign, nonatomic) BOOL clearPasteboardOnShutdown;
@property (class, strong, readonly) MPPasteBoardController *defaultController;
+ (MPPasteBoardController *)defaultController;
- (void)stashObjects; - (void)stashObjects;
- (void)restoreObjects; - (void)restoreObjects;