Revision: 29140
http://sourceforge.net/p/bibdesk/svn/29140
Author: hofman
Date: 2025-04-19 16:27:41 +0000 (Sat, 19 Apr 2025)
Log Message:
-----------
Don't determine whether a drag has URLs in draggingEntered, as that may not be
called for drags from self.
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-19
15:59:34 UTC (rev 29139)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-19
16:27:41 UTC (rev 29140)
@@ -165,11 +165,9 @@
@interface FVDropHighlightView : FVDisplayView {
NSUInteger _dropIndex;
FVDropOperation _dropOperation;
- BOOL _dragHasURLs;
}
@property (nonatomic) NSUInteger dropIndex;
@property (nonatomic) FVDropOperation dropOperation;
-@property (nonatomic) BOOL dragHasURLs;
@end
#pragma mark -
@@ -2836,7 +2834,10 @@
// We won't reset the drop location info when we propose
NSDragOperationNone, because the delegate may want to override our decision, we
will reset it at the end
- if ([_dropHighlightView dragHasURLs] == NO) {
+ // !!! this is quite expensive to call repeatedly in -draggingUpdated
+ BOOL dragHasURLs = FVPasteboardHasURL([sender draggingPasteboard]);
+
+ if (dragHasURLs == NO) {
// We have to make sure the pasteboard really has a URL here, since
most NSStrings aren't valid URLs, but the delegate may accept other types
dragOp = NSDragOperationNone;
}
@@ -2867,6 +2868,10 @@
dragOp = NSDragOperationLink;
}
+ if (_dropHighlightView == nil) {
+ _dropHighlightView = [[FVDropHighlightView alloc]
initWithFrame:[_contentView bounds] delegate:self];
+ [_contentView addSubview:_dropHighlightView];
+ }
[_dropHighlightView setDropIndex:dropIndex];
[_dropHighlightView setDropOperation:dropOp];
@@ -2887,12 +2892,6 @@
// this is called as soon as the mouse is moved to start a drag, or enters the
window from outside
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
- if (_dropHighlightView == nil) {
- _dropHighlightView = [[FVDropHighlightView alloc]
initWithFrame:[_contentView bounds] delegate:self];
- [_contentView addSubview:_dropHighlightView];
- }
- // !!! this is quite expensive to call repeatedly in -draggingUpdated
- [_dropHighlightView setDragHasURLs:FVPasteboardHasURL([sender
draggingPasteboard])];
return [self draggingUpdated:sender];
}
@@ -5113,7 +5112,6 @@
@synthesize dropIndex=_dropIndex;
@synthesize dropOperation=_dropOperation;
-@synthesize dragHasURLs=_dragHasURLs;
- (id)initWithFrame:(NSRect)frameRect {
self = [super initWithFrame:frameRect];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit