From c9dcf25ab7cae860010ea2e8a8844723514ce436 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 5 Jan 2011 21:54:29 -0500 Subject: [PATCH] Revert "Add drag and drop for the table view." This reverts commit 7a8a10f2673ce531fcb38cfec89a04991bbe09c0. --- English.lproj/Breakpoints.xib | 12 ++---------- Source/BreakpointController.m | 30 +----------------------------- Source/BreakpointManager.m | 22 ++++++++++------------ 3 files changed, 13 insertions(+), 51 deletions(-) diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib index c1093b5..1574853 100644 --- a/English.lproj/Breakpoints.xib +++ b/English.lproj/Breakpoints.xib @@ -12,7 +12,7 @@ YES - + YES @@ -480,14 +480,6 @@ 50 - - - dataSource - - - - 51 - @@ -749,7 +741,7 @@ - 51 + 50 diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index 1f08eba..ef3e5a9 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -43,8 +43,6 @@ */ - (void)awakeFromNib { - NSArray* dragTypes = [NSArray arrayWithObject:NSFilenamesPboardType]; - [tableView_ registerForDraggedTypes:dragTypes]; } /** @@ -88,8 +86,7 @@ Breakpoint* bp = [selection objectAtIndex:0]; [sourceView_ setFile:[bp file]]; - if ([bp line] > 0) - [sourceView_ scrollToLine:[bp line]]; + [sourceView_ scrollToLine:[bp line]]; [[sourceView_ numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:[bp file]]]]; } @@ -102,8 +99,6 @@ writeRowsWithIndexes:(NSIndexSet*)rowIndexes toPasteboard:(NSPasteboard*)pboard { - NSLog(@"begin"); - return [[pboard types] containsObject:NSFilenamesPboardType]; } /** @@ -114,14 +109,6 @@ proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation { - NSLog(@"validate"); - NSPasteboard* pboard = [info draggingPasteboard]; - if ([[pboard types] containsObject:NSFilenamesPboardType]) { - NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; - if ([files count]) - return NSDragOperationGeneric; - } - return NSDragOperationNone; } /** @@ -132,21 +119,6 @@ row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation { - NSLog(@"accept"); - BOOL valid = [self tableView:aTableView - validateDrop:info - proposedRow:row - proposedDropOperation:operation] == NSDragOperationGeneric; - if (valid) { - NSPasteboard* pboard = [info draggingPasteboard]; - NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; - for (NSString* file in files) { - Breakpoint* bp = [[[Breakpoint alloc] initWithLine:0 inFile:file] autorelease]; - [manager addBreakpoint:bp]; - } - return YES; - } - return NO; } #pragma mark BSSourceView Delegate diff --git a/Source/BreakpointManager.m b/Source/BreakpointManager.m index 6d4bcb8..0407a47 100644 --- a/Source/BreakpointManager.m +++ b/Source/BreakpointManager.m @@ -67,14 +67,13 @@ */ - (void)addBreakpoint:(Breakpoint*)bp; { - if (![breakpoints containsObject:bp]) { + if (![breakpoints containsObject:bp]) + { [breakpoints addObject:bp]; - if (bp.line > 0) { - [connection addBreakpoint:bp]; - - [savedBreakpoints addObject:[bp dictionary]]; - [[NSUserDefaults standardUserDefaults] setValue:savedBreakpoints forKey:@"Breakpoints"]; - } + [connection addBreakpoint:bp]; + + [savedBreakpoints addObject:[bp dictionary]]; + [[NSUserDefaults standardUserDefaults] setValue:savedBreakpoints forKey:@"Breakpoints"]; [self updateDisplaysForFile:[bp file]]; } @@ -90,12 +89,11 @@ if ([b line] == line && [[b file] isEqualToString:file]) { [breakpoints removeObject:b]; - if (b.line > 0) - [connection removeBreakpoint:b]; - + [connection removeBreakpoint:b]; + [savedBreakpoints removeObject:[b dictionary]]; [[NSUserDefaults standardUserDefaults] setValue:savedBreakpoints forKey:@"Breakpoints"]; - + [self updateDisplaysForFile:file]; return b; } @@ -111,7 +109,7 @@ NSMutableArray* matches = [NSMutableArray array]; for (Breakpoint* b in breakpoints) { - if ([[b file] isEqualToString:file] && [b line] > 0) + if ([[b file] isEqualToString:file]) { [matches addObject:b]; } -- 2.43.5