Enabled drag and drop of search result for reordering

This commit is contained in:
Michael Starke
2018-11-15 18:07:16 +01:00
parent f94dc84bfa
commit 3fcb7305d3

View File

@@ -34,7 +34,7 @@
// FIXME: change drag image to use only the first column regardless of drag start // FIXME: change drag image to use only the first column regardless of drag start
- (id<NSPasteboardWriting>)tableView:(NSTableView *)tableView pasteboardWriterForRow:(NSInteger)row { - (id<NSPasteboardWriting>)tableView:(NSTableView *)tableView pasteboardWriterForRow:(NSInteger)row {
if(MPDisplayModeEntries != self.viewController.displayMode) { if(MPDisplayModeHistory == self.viewController.displayMode) {
return nil; return nil;
} }
@@ -51,7 +51,7 @@
- (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id<NSDraggingInfo>)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation { - (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id<NSDraggingInfo>)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation {
/* we do not accept drops if we are in history or search display mode */ /* we do not accept drops if we are in history or search display mode */
if(MPDisplayModeEntries != self.viewController.displayMode) { if(self.viewController.displayMode != MPDisplayModeEntries) {
return NSDragOperationNone; return NSDragOperationNone;
} }
BOOL isLocalDrag = info.draggingSource == tableView; BOOL isLocalDrag = info.draggingSource == tableView;