From 3c4eac6707ee297ee7c71b7fd67aec95c46f0e78 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 17 Feb 2021 17:56:21 +0100 Subject: [PATCH] Updated to modern Obj-C --- MacPass/MPDocumentWindowDelegate.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MacPass/MPDocumentWindowDelegate.m b/MacPass/MPDocumentWindowDelegate.m index 55caea27..56168846 100644 --- a/MacPass/MPDocumentWindowDelegate.m +++ b/MacPass/MPDocumentWindowDelegate.m @@ -28,13 +28,12 @@ @implementation MPDocumentWindowDelegate - (NSDragOperation)draggingEntered:(id)sender { - - MPDocument *document = [[[sender draggingDestinationWindow] windowController] document]; + MPDocument *document = sender.draggingDestinationWindow.windowController.document; if(document.encrypted) { return NSDragOperationNone; } - NSPasteboard *draggingPasteBoard = [sender draggingPasteboard]; + NSPasteboard *draggingPasteBoard = sender.draggingPasteboard; NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil]; BOOL ok = YES; @@ -52,7 +51,7 @@ } - (BOOL)performDragOperation:(id)sender { - NSPasteboard *draggingPasteBoard = [sender draggingPasteboard]; + NSPasteboard *draggingPasteBoard = sender.draggingPasteboard; NSArray *arrayOfURLs = [draggingPasteBoard readObjectsForClasses:@[NSURL.class] options:nil]; NSURL *url = arrayOfURLs.lastObject; @@ -60,7 +59,7 @@ return NO; } /* 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; [document.undoManager beginUndoGrouping]; KPKEntry *entry = [document createEntry:parentGroup];