code style

This commit is contained in:
michael starke
2017-09-27 16:32:44 +02:00
parent 61826229c8
commit 18c2c1871f
2 changed files with 10 additions and 8 deletions

View File

@@ -269,12 +269,12 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
NSString *iconImageKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(iconImage))];
NSString *titleKeyPath = [NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(title))];
[[view imageView] bind:NSValueBinding toObject:item withKeyPath:iconImageKeyPath options:nil];
[[view textField] bind:NSValueBinding toObject:item withKeyPath:titleKeyPath options:nil];
[view.imageView bind:NSValueBinding toObject:item withKeyPath:iconImageKeyPath options:nil];
[view.textField bind:NSValueBinding toObject:item withKeyPath:titleKeyPath options:nil];
NSString *entriesCountKeyPath = [[NSString alloc] initWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(entries)), @"@count"];
[[view textField] bind:NSStringFromSelector(@selector(count)) toObject:item withKeyPath:entriesCountKeyPath options:nil];
NSString *entriesCountKeyPath = [[NSString alloc] initWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(representedObject)), NSStringFromSelector(@selector(mutableEntries)), @"@count"];
[view.textField bind:NSStringFromSelector(@selector(count)) toObject:item withKeyPath:entriesCountKeyPath options:nil];
}
return view;
@@ -309,7 +309,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
}
}
- (void)outlineViewItemDidCollapse:(NSNotification *)notification {
NSDictionary *userInfo = [notification userInfo];
NSDictionary *userInfo = notification.userInfo;
id item = userInfo[NSStringFromClass([NSObject class])];
id representedObject = [item representedObject];
if([representedObject isKindOfClass:[KPKGroup class]]) {
@@ -328,7 +328,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
#pragma mark Validation
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
MPDocument *document = [[self windowController] document];
MPDocument *document = self.windowController.document;
if(![document validateUserInterfaceItem:menuItem]) {
return NO;
}
@@ -338,7 +338,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
- (NSMenu *)_contextMenu {
NSMenu *menu = [[NSMenu alloc] init];
[menu setDelegate:_menuDelegate];
menu.delegate = _menuDelegate;
return menu;
}

View File

@@ -96,7 +96,9 @@
- (void)_updateNote {
NSString *uti = self.fileTypePopupButton.selectedItem.representedObject;
BOOL showInfoText = [uti isEqualToString:MPKdbDocumentUTI] && (self.document.tree.minimumVersion.format == KPKDatabaseFormatKdbx) && [self.document.fileType isEqualToString:MPKdbxDocumentUTI];
BOOL showInfoText = ([uti isEqualToString:MPKdbDocumentUTI] &&
(self.document.tree.minimumVersion.format == KPKDatabaseFormatKdbx) &&
[self.document.fileType isEqualToString:MPKdbxDocumentUTI]);
self.infoTextField.hidden = !showInfoText;
}