Revision: 27579
http://sourceforge.net/p/bibdesk/svn/27579
Author: hofman
Date: 2022-06-08 08:56:13 +0000 (Wed, 08 Jun 2022)
Log Message:
-----------
pass only single item to replacement delegate method
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView Program/Controller.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2022-06-08
06:30:17 UTC (rev 27578)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2022-06-08
08:56:13 UTC (rev 27579)
@@ -117,7 +117,7 @@
/** The datasource may replace the files at the given indexes
@return YES if the replacement occurred.
*/
-- (BOOL)fileView:(FVFileView *)aFileView replaceURLsAtIndexes:(NSIndexSet
*)aSet withURLs:(NSArray *)newURLs forDrop:(id <NSDraggingInfo>)info
dropOperation:(FVDropOperation)operation;
+- (BOOL)fileView:(FVFileView *)aFileView replaceURLAtIndex:(NSUInteger)anIndex
withURL:(NSURL *)newURL forDrop:(id <NSDraggingInfo>)info
dropOperation:(FVDropOperation)operation;
/** Rearranging files in the view
@return YES if the rearrangement occurred.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2022-06-08
06:30:17 UTC (rev 27578)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2022-06-08
08:56:13 UTC (rev 27579)
@@ -666,7 +666,7 @@
const SEL selectors[] =
{
@selector(fileView:insertURLs:atIndexes:forDrop:dropOperation:),
-
@selector(fileView:replaceURLsAtIndexes:withURLs:forDrop:dropOperation:),
+
@selector(fileView:replaceURLAtIndex:withURL:forDrop:dropOperation:),
@selector(fileView:moveURLsAtIndexes:toIndex:forDrop:dropOperation:),
@selector(fileView:deleteURLsAtIndexes:)
};
@@ -3025,7 +3025,7 @@
aURL = [NSURL fileURLWithPath:[[pboard
propertyListForType:NSFilenamesPboardType] lastObject]];
}
if (aURL)
- didPerform = [[self dataSource] fileView:self
replaceURLsAtIndexes:[NSIndexSet indexSetWithIndex:_dropIndex]
withURLs:[NSArray arrayWithObject:aURL] forDrop:sender
dropOperation:_fvFlags.dropOperation];
+ didPerform = [[self dataSource] fileView:self
replaceURLAtIndex:_dropIndex withURL:aURL forDrop:sender
dropOperation:_fvFlags.dropOperation];
}
if ([downloads count]) {
@@ -4201,7 +4201,7 @@
NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:idx];
if (replace == NO) {
[[self dataSource] fileView:self insertURLs:urls
atIndexes:indexes forDrop:nil dropOperation:FVDropBefore];
- } else if ([[self dataSource] fileView:self
replaceURLsAtIndexes:indexes withURLs:urls forDrop:nil dropOperation:FVDropOn])
{
+ } else if ([[self dataSource] fileView:self replaceURLAtIndex:idx
withURL:dest forDrop:nil dropOperation:FVDropOn]) {
NSUInteger r, c;
if ([self _getGridRow:&r column:&c ofIndex:idx])
[self _setNeedsDisplayForIconInRow:r column:c];
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView
Program/Controller.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView Program/Controller.m
2022-06-08 06:30:17 UTC (rev 27578)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView Program/Controller.m
2022-06-08 08:56:13 UTC (rev 27579)
@@ -124,11 +124,11 @@
[arrayController insertObjects:absoluteURLs atArrangedObjectIndexes:aSet];
}
-- (BOOL)fileView:(FVFileView *)fileView replaceURLsAtIndexes:(NSIndexSet
*)aSet withURLs:(NSArray *)newURLs forDrop:(id <NSDraggingInfo>)info
dropOperation:(FVDropOperation)operation;
+- (BOOL)fileView:(FVFileView *)fileView replaceURLAtIndex:(NSUInteger)anIndex
withURL:(NSURL *)newURL forDrop:(id <NSDraggingInfo>)info
dropOperation:(FVDropOperation)operation;
{
- if ([_filePaths count] > [aSet count]) {
- [arrayController removeObjectsAtArrangedObjectIndexes:aSet];
- [arrayController insertObjects:newURLs atArrangedObjectIndexes:aSet];
+ if ([_filePaths count] > 1) {
+ [arrayController removeObjectAtArrangedObjectIndex:anIndex];
+ [arrayController insertObject:newURL atArrangedObjectIndex:anIndex];
return YES;
}
return NO;
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