mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 11:42:30 +00:00
fixed wrong target groups, consolidated node resolving
This commit is contained in:
@@ -135,10 +135,10 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
|||||||
|
|
||||||
#pragma mark MPTargetNodeResolving
|
#pragma mark MPTargetNodeResolving
|
||||||
- (NSArray<KPKGroup *> *)currentTargetGroups {
|
- (NSArray<KPKGroup *> *)currentTargetGroups {
|
||||||
// NSInteger row = self.outlineView.clickedRow;
|
/* there are instances where we get the KPKTree tree as selection, so filter this out! */
|
||||||
// if( row > -1 ) {
|
if([self.treeController.selectedObjects.firstObject isKindOfClass:[KPKTree class]] ) {
|
||||||
// return @[ [[self.outlineView itemAtRow:row] representedObject] ];
|
return @[];
|
||||||
// }
|
}
|
||||||
return self.treeController.selectedObjects;
|
return self.treeController.selectedObjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,8 +167,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
|||||||
return; // Nothing we need to worry about
|
return; // Nothing we need to worry about
|
||||||
}
|
}
|
||||||
MPDocument *document = [[self windowController] document];
|
MPDocument *document = [[self windowController] document];
|
||||||
document.selectedGroups = self.treeController.selectedObjects;
|
document.selectedGroups = [self currentTargetGroups];
|
||||||
//document.selectedItem = document.selectedGroup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# pragma mark MPDocument Notifications
|
# pragma mark MPDocument Notifications
|
||||||
@@ -233,12 +232,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
|||||||
|
|
||||||
- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
|
- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
|
||||||
MPDocument *document = self.windowController.document;
|
MPDocument *document = self.windowController.document;
|
||||||
if(![self.treeController.selectedObjects.firstObject isKindOfClass:[KPKTree class]]) {
|
document.selectedGroups = [self currentTargetGroups];
|
||||||
document.selectedGroups = self.treeController.selectedObjects;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
document.selectedGroups = nil;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item {
|
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item {
|
||||||
|
|||||||
Reference in New Issue
Block a user