mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 07:08:17 +00:00
Copy and drag between documents should work now
This commit is contained in:
Submodule KeePassKit updated: 143af5cc3d...cde7f6323d
@@ -23,12 +23,11 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation MPOutlineDataSource
|
@implementation MPOutlineDataSource
|
||||||
|
|
||||||
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard {
|
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard {
|
||||||
if([items count] == 1) {
|
if([items count] == 1) {
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -90,6 +89,7 @@
|
|||||||
validTarget &= !isAnchesor;
|
validTarget &= !isAnchesor;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
/* Copy can always work in this case */
|
||||||
operationMask = NSDragOperationCopy;
|
operationMask = NSDragOperationCopy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,12 +129,8 @@
|
|||||||
KPKGroup *targetGroup = (KPKGroup *)targetItem;
|
KPKGroup *targetGroup = (KPKGroup *)targetItem;
|
||||||
if(draggedGroup) {
|
if(draggedGroup) {
|
||||||
if(copyItem || (nil == self.localDraggedGroup) ) {
|
if(copyItem || (nil == self.localDraggedGroup) ) {
|
||||||
/*
|
[targetGroup addGroup:draggedGroup atIndex:index];
|
||||||
Scenarios:
|
return YES;
|
||||||
a) Local copy
|
|
||||||
b) Drag from other document
|
|
||||||
*/
|
|
||||||
return NO;
|
|
||||||
}
|
}
|
||||||
else if(self.localDraggedGroup) {
|
else if(self.localDraggedGroup) {
|
||||||
/* Simple move */
|
/* Simple move */
|
||||||
@@ -147,12 +143,8 @@
|
|||||||
}
|
}
|
||||||
else if(draggedEntry) {
|
else if(draggedEntry) {
|
||||||
if(copyItem || (nil == self.localDraggedEntry)) {
|
if(copyItem || (nil == self.localDraggedEntry)) {
|
||||||
/*
|
[targetGroup addEntry:draggedEntry atIndex:index];
|
||||||
Scenarios:
|
return YES;
|
||||||
a) Local copy
|
|
||||||
b) Drag from other document
|
|
||||||
*/
|
|
||||||
return NO;
|
|
||||||
}
|
}
|
||||||
else if(self.localDraggedEntry) {
|
else if(self.localDraggedEntry) {
|
||||||
[self.localDraggedEntry moveToGroup:targetGroup atIndex:index];
|
[self.localDraggedEntry moveToGroup:targetGroup atIndex:index];
|
||||||
|
|||||||
Reference in New Issue
Block a user