removed unused code

This commit is contained in:
michael starke
2016-08-24 16:24:43 +02:00
parent d776d1d8a0
commit 55ab84b6bd
6 changed files with 16 additions and 57 deletions

View File

@@ -52,7 +52,6 @@
@property (weak) IBOutlet NSTextField *associationSequenceTextField;
- (void)setupBindings:(MPDocument *)document;
- (void)registerNotificationsForDocument:(MPDocument *)document;
- (IBAction)saveAttachment:(id)sender;

View File

@@ -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:)

View File

@@ -22,7 +22,6 @@
@property (weak) IBOutlet NSPopUpButton *autotypePopupButton;
@property (weak) IBOutlet HNHUIRoundedTextField *autotypeSequenceTextField;
- (void)setupBindings:(MPDocument *)document;
- (void)beginEditing;
- (void)endEditing;

View File

@@ -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];
}

View File

@@ -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 {

View File

@@ -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