From 45038a9c9d15547037dea6d97a1b801a68c30f1a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 2 Sep 2019 23:51:28 -0400 Subject: [PATCH] Remove unneeded -[BSSourceViewDelegate sourceView:acceptsDropOfFile:]. Now that the breakpoints window does not have its own source viewer, it is unnecessary. Unconditionally allow file drops. --- Source/BSSourceView.h | 2 -- Source/BSSourceView.mm | 11 +++-------- Source/BreakpointController.h | 2 +- Source/BreakpointController.m | 10 ---------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/Source/BSSourceView.h b/Source/BSSourceView.h index 445a56f..ed11ff9 100644 --- a/Source/BSSourceView.h +++ b/Source/BSSourceView.h @@ -62,6 +62,4 @@ // Notifies the delegate that the gutter was clicked at a certain line. - (void)gutterClickedAtLine:(NSUInteger)line forFile:(NSString*)file; -// Whether to accept a file drop. -- (BOOL)sourceView:(BSSourceView*)sv acceptsDropOfFile:(NSString*)fileName; @end diff --git a/Source/BSSourceView.mm b/Source/BSSourceView.mm index 98e1943..37aa222 100644 --- a/Source/BSSourceView.mm +++ b/Source/BSSourceView.mm @@ -258,9 +258,7 @@ */ - (NSDragOperation)draggingEntered:(id)sender { - if ([delegate_ respondsToSelector:@selector(sourceView:acceptsDropOfFile:)]) - return NSDragOperationCopy; - return NSDragOperationNone; + return NSDragOperationCopy; } /** @@ -273,11 +271,8 @@ NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; if ([files count]) { NSString* filename = [files objectAtIndex:0]; - if ([delegate_ respondsToSelector:@selector(sourceView:acceptsDropOfFile:)] && - [delegate_ sourceView:self acceptsDropOfFile:filename]) { - [self setFile:filename]; - return YES; - } + [self setFile:filename]; + return YES; } } return NO; diff --git a/Source/BreakpointController.h b/Source/BreakpointController.h index 0a3745f..41abcec 100644 --- a/Source/BreakpointController.h +++ b/Source/BreakpointController.h @@ -19,7 +19,7 @@ #import "BreakpointManager.h" #import "BSSourceView.h" -@interface BreakpointController : NSViewController +@interface BreakpointController : NSViewController @property(nonatomic, assign) IBOutlet NSPopUpButton* addBreakpointButton; @property(nonatomic, assign) IBOutlet NSArrayController* arrayController; diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index d4bd86d..99f495d 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -117,14 +117,4 @@ [_sourceView setMarkers:[_manager breakpointsForFile:bp.file]]; } -#pragma mark BSSourceView Delegate - -/** - * Accepts a file dragged to set the contents of the display. - */ -- (BOOL)sourceView:(BSSourceView*)sv acceptsDropOfFile:(NSString*)filename -{ - return YES; -} - @end -- 2.22.5