mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 22:42:18 +00:00
Multiple selections are now handled correctly
This commit is contained in:
@@ -32,17 +32,13 @@
|
||||
@implementation MPEntryTableDataSource
|
||||
|
||||
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {
|
||||
|
||||
if([rowIndexes count] != 1) {
|
||||
return NO; // No valid drag
|
||||
NSArray *entries = self.viewController.entryArrayController.selectedObjects;
|
||||
for(KPKEntry *entry in entries) {
|
||||
if(![entry isKindOfClass:[KPKEntry class]]) {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
id item = [self.viewController.entryArrayController arrangedObjects][[rowIndexes firstIndex]];
|
||||
if(![item isKindOfClass:[KPKEntry class]]) {
|
||||
return NO;
|
||||
}
|
||||
KPKEntry *draggedEntry = (KPKEntry *)item;
|
||||
[pboard writeObjects:@[draggedEntry]];
|
||||
[pboard writeObjects:entries];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user