From 55ab84b6bded3119169273bc99d796a8ec5e3612 Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 24 Aug 2016 16:24:43 +0200 Subject: [PATCH] removed unused code --- MacPass/MPEntryInspectorViewController.h | 1 - MacPass/MPEntryInspectorViewController.m | 4 --- MacPass/MPGroupInspectorViewController.h | 1 - MacPass/MPGroupInspectorViewController.m | 39 ++++++++---------------- MacPass/MPInspectorViewController.m | 3 -- MacPass/MPObjectController.m | 25 +++------------ 6 files changed, 16 insertions(+), 57 deletions(-) diff --git a/MacPass/MPEntryInspectorViewController.h b/MacPass/MPEntryInspectorViewController.h index 54ed643b..2b9464e7 100644 --- a/MacPass/MPEntryInspectorViewController.h +++ b/MacPass/MPEntryInspectorViewController.h @@ -52,7 +52,6 @@ @property (weak) IBOutlet NSTextField *associationSequenceTextField; -- (void)setupBindings:(MPDocument *)document; - (void)registerNotificationsForDocument:(MPDocument *)document; - (IBAction)saveAttachment:(id)sender; diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index ab94ad03..cf6df36c 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -125,10 +125,6 @@ static NSString *kMPContentBindingString3 = @"content.%@.%@.%@"; [self _setupViewBindings]; } -- (void)setupBindings:(MPDocument *)document { - //[self.entryController bind:NSContentObjectBinding toObject:self withKeyPath:NSStringFromSelector(@selector(representedObject)) options:nil]; -} - - (void)registerNotificationsForDocument:(MPDocument *)document { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didAddEntry:) diff --git a/MacPass/MPGroupInspectorViewController.h b/MacPass/MPGroupInspectorViewController.h index 66053caa..3d1b58d1 100644 --- a/MacPass/MPGroupInspectorViewController.h +++ b/MacPass/MPGroupInspectorViewController.h @@ -22,7 +22,6 @@ @property (weak) IBOutlet NSPopUpButton *autotypePopupButton; @property (weak) IBOutlet HNHUIRoundedTextField *autotypeSequenceTextField; -- (void)setupBindings:(MPDocument *)document; - (void)beginEditing; - (void)endEditing; diff --git a/MacPass/MPGroupInspectorViewController.m b/MacPass/MPGroupInspectorViewController.m index ec78ac55..cb1b0909 100644 --- a/MacPass/MPGroupInspectorViewController.m +++ b/MacPass/MPGroupInspectorViewController.m @@ -17,10 +17,7 @@ #import "HNHUi/HNHUi.h" @interface MPGroupInspectorViewController () - -//@property (nonatomic, weak) KPKGroup *group; @property (strong) NSPopover *popover; -@property (strong) MPObjectController *groupController; @end @@ -30,14 +27,6 @@ return @"GroupInspectorView"; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - _groupController = [[MPObjectController alloc] init]; - } - return self; -} - - (void)awakeFromNib { HNHUIScrollView *scrollView = (HNHUIScrollView *)self.view; @@ -84,34 +73,30 @@ [self _establishBindings]; } -- (void)setupBindings:(MPDocument *)document { - [self.groupController bind:NSContentObjectBinding toObject:self withKeyPath:NSStringFromSelector(@selector(representedObject)) options:nil]; -} - - (void)_establishBindings { [self.titleTextField bind:NSValueBinding - toObject:self.groupController - withKeyPath:[NSString stringWithFormat:@"%@.%@", NSContentBinding, NSStringFromSelector(@selector(title))] + toObject:self + withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(title))] options:@{NSNullPlaceholderBindingOption: NSLocalizedString(@"NONE", @"")}]; [self.expiresCheckButton bind:NSValueBinding - toObject:self.groupController - withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSContentBinding, NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expires))] + toObject:self + withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expires))] options:nil]; [self.expiresCheckButton bind:NSTitleBinding - toObject:self.groupController - withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSContentBinding, NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expirationDate))] + toObject:self + withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(timeInfo)), NSStringFromSelector(@selector(expirationDate))] options:@{ NSValueTransformerNameBindingOption:MPExpiryDateValueTransformer }]; [self.autotypePopupButton bind:NSSelectedTagBinding - toObject:self.groupController - withKeyPath:[NSString stringWithFormat:@"%@.%@", NSContentBinding, NSStringFromSelector(@selector(isAutoTypeEnabled))] + toObject:self + withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(isAutoTypeEnabled))] options:nil]; [self.autotypeSequenceTextField bind:NSValueBinding - toObject:self.groupController - withKeyPath:[NSString stringWithFormat:@"%@.%@", NSContentBinding, NSStringFromSelector(@selector(defaultAutoTypeSequence))] + toObject:self + withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(defaultAutoTypeSequence))] options:@{NSNullPlaceholderBindingOption: NSLocalizedString(@"NONE", @"")}]; [self.searchPopupButton bind:NSSelectedTagBinding - toObject:self.groupController - withKeyPath:[NSString stringWithFormat:@"%@.%@", NSContentBinding, NSStringFromSelector(@selector(isSearchEnabled))] + toObject:self + withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(isSearchEnabled))] options:nil]; } diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m index 1ed394bd..567af7c1 100644 --- a/MacPass/MPInspectorViewController.m +++ b/MacPass/MPInspectorViewController.m @@ -110,9 +110,6 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { name:MPDocumentCurrentItemChangedNotification object:document]; [self.entryViewController registerNotificationsForDocument:document]; - - [self.entryViewController setupBindings:document]; - [self.groupViewController setupBindings:document]; } - (void)updateResponderChain { diff --git a/MacPass/MPObjectController.m b/MacPass/MPObjectController.m index ae65330b..a0bd95ab 100644 --- a/MacPass/MPObjectController.m +++ b/MacPass/MPObjectController.m @@ -10,15 +10,6 @@ @implementation MPObjectController -//- (void)objectDidBeginEditing:(id)editor { -// NSLog(@"objectDidBeginEditing:%@", editor); -// [super objectDidBeginEditing:editor]; -//} -//- (void)objectDidEndEditing:(id)editor { -// NSLog(@"objectDidEndEditing:%@", editor); -// [super objectDidEndEditing:editor]; -//} - - (void)discardEditing { [super discardEditing]; } @@ -27,17 +18,9 @@ return [super commitEditing]; } - -//- (BOOL)commitEditing { -// return [super commitEditing]; -//} -// -//- (BOOL)commitEditingAndReturnError:(NSError * _Nullable __autoreleasing *)error { -// return [super commitEditingAndReturnError:error]; -//} -// -//- (void)commitEditingWithDelegate:(id)delegate didCommitSelector:(SEL)didCommitSelector contextInfo:(void *)contextInfo { -// [super commitEditingWithDelegate:delegate didCommitSelector:didCommitSelector contextInfo:contextInfo]; -//} +- (void)setValue:(id)value forKeyPath:(NSString *)keyPath { + NSLog(@"[%@ setValue:%@ forKeyPath:%@]", NSStringFromClass([self class]), value, keyPath); + [super setValue:value forKeyPath:keyPath]; +} @end