mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 23:52:16 +00:00
Updated to modern Obj-C
This commit is contained in:
@@ -28,13 +28,12 @@
|
|||||||
@implementation MPDocumentWindowDelegate
|
@implementation MPDocumentWindowDelegate
|
||||||
|
|
||||||
- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
|
- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
|
||||||
|
MPDocument *document = sender.draggingDestinationWindow.windowController.document;
|
||||||
MPDocument *document = [[[sender draggingDestinationWindow] windowController] document];
|
|
||||||
if(document.encrypted) {
|
if(document.encrypted) {
|
||||||
return NSDragOperationNone;
|
return NSDragOperationNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSPasteboard *draggingPasteBoard = [sender draggingPasteboard];
|
NSPasteboard *draggingPasteBoard = sender.draggingPasteboard;
|
||||||
|
|
||||||
NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil];
|
NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil];
|
||||||
BOOL ok = YES;
|
BOOL ok = YES;
|
||||||
@@ -52,7 +51,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
|
- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
|
||||||
NSPasteboard *draggingPasteBoard = [sender draggingPasteboard];
|
NSPasteboard *draggingPasteBoard = sender.draggingPasteboard;
|
||||||
NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil];
|
NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil];
|
||||||
|
|
||||||
NSURL *url = arrayOfURLs.lastObject;
|
NSURL *url = arrayOfURLs.lastObject;
|
||||||
@@ -60,7 +59,7 @@
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
/* Currently not working, as the underlying operations do not get the undomanager */
|
/* Currently not working, as the underlying operations do not get the undomanager */
|
||||||
MPDocument *document = [sender draggingDestinationWindow].windowController.document;
|
MPDocument *document = sender.draggingDestinationWindow.windowController.document;
|
||||||
KPKGroup *parentGroup = document.selectedGroups.count == 1 ? document.selectedGroups.firstObject : document.root;
|
KPKGroup *parentGroup = document.selectedGroups.count == 1 ? document.selectedGroups.firstObject : document.root;
|
||||||
[document.undoManager beginUndoGrouping];
|
[document.undoManager beginUndoGrouping];
|
||||||
KPKEntry *entry = [document createEntry:parentGroup];
|
KPKEntry *entry = [document createEntry:parentGroup];
|
||||||
|
|||||||
Reference in New Issue
Block a user