mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +00:00
fixed using wrong entries for drag and drop
This commit is contained in:
@@ -32,7 +32,10 @@
|
|||||||
@implementation MPEntryTableDataSource
|
@implementation MPEntryTableDataSource
|
||||||
|
|
||||||
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {
|
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {
|
||||||
NSArray *entries = self.viewController.entryArrayController.selectedObjects;
|
NSMutableArray *entries = [[NSMutableArray alloc] initWithCapacity:rowIndexes.count];
|
||||||
|
[rowIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
|
[entries addObject:self.viewController.entryArrayController.arrangedObjects[idx]];
|
||||||
|
}];
|
||||||
for(KPKEntry *entry in entries) {
|
for(KPKEntry *entry in entries) {
|
||||||
if(![entry isKindOfClass:[KPKEntry class]]) {
|
if(![entry isKindOfClass:[KPKEntry class]]) {
|
||||||
return NO;
|
return NO;
|
||||||
|
|||||||
@@ -333,8 +333,8 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
}
|
}
|
||||||
else if(isHistoryColumn) {
|
else if(isHistoryColumn) {
|
||||||
NSString *historyCountKeyPath = [NSString stringWithFormat:@"%@.%@.@count",
|
NSString *historyCountKeyPath = [NSString stringWithFormat:@"%@.%@.@count",
|
||||||
NSStringFromSelector(@selector(objectValue)),
|
NSStringFromSelector(@selector(objectValue)),
|
||||||
NSStringFromSelector(@selector(history))];
|
NSStringFromSelector(@selector(history))];
|
||||||
[view.textField bind:NSValueBinding toObject:view withKeyPath:historyCountKeyPath options:nil];
|
[view.textField bind:NSValueBinding toObject:view withKeyPath:historyCountKeyPath options:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,11 +359,10 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
|||||||
|
|
||||||
#pragma mark MPTargetItemResolving
|
#pragma mark MPTargetItemResolving
|
||||||
- (NSArray<KPKEntry *> *)currentTargetEntries {
|
- (NSArray<KPKEntry *> *)currentTargetEntries {
|
||||||
/*NSInteger activeRow = self.entryTable.clickedRow;
|
NSInteger activeRow = self.entryTable.clickedRow;
|
||||||
if(activeRow > -1) {
|
if(activeRow > -1) {
|
||||||
return @[ [self.entryArrayController arrangedObjects][activeRow] ];
|
return @[ [self.entryArrayController arrangedObjects][activeRow] ];
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return self.entryArrayController.selectedObjects;
|
return self.entryArrayController.selectedObjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
if(items.count != 1) {
|
if(items.count != 1) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
self.localDraggedGroup = nil; id item = [[items lastObject] representedObject];
|
self.localDraggedGroup = nil; id item = [items.lastObject representedObject];
|
||||||
if(![item isKindOfClass:[KPKGroup class]]) {
|
if(![item isKindOfClass:[KPKGroup class]]) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user