Revision: 30098
          http://sourceforge.net/p/bibdesk/svn/30098
Author:   hofman
Date:     2026-03-03 17:19:58 +0000 (Tue, 03 Mar 2026)
Log Message:
-----------
Also update the indexes for downloads when reloading the URLs

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h      2026-03-03 
17:08:56 UTC (rev 30097)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h      2026-03-03 
17:19:58 UTC (rev 30098)
@@ -58,7 +58,7 @@
 @property (nonatomic, weak) id<FVDownloadDelegate> delegate;
 
 @property (nonatomic, readonly) NSURL *downloadURL;
-@property (nonatomic, readonly) NSUInteger indexInView;
+@property (nonatomic) NSUInteger indexInView;
 @property (nonatomic, readonly) BOOL replace;
 
 @property (nonatomic, strong) NSURL *fileURL;

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2026-03-03 
17:08:56 UTC (rev 30097)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2026-03-03 
17:19:58 UTC (rev 30098)
@@ -1767,13 +1767,15 @@
     return frame;
 }
 
-- (void)_updateProgressIndicatorFrames {
+- (void)_updateProgressIndicatorFrames;
+{
     [_progressIndicators enumerateKeysAndObjectsUsingBlock:^(NSURL *url, 
FVProgressIndicator *progressIndicator, BOOL *stop){
         [progressIndicator setFrame:[self 
_rectOfProgressIndicatorForIconAtIndex:[progressIndicator indexInView]]];
     }];
 }
 
-- (void)_updateProgressIndicatorIndexes {
+- (void)_updateProgressIndicatorIndexes;
+{
     [_progressIndicators enumerateKeysAndObjectsUsingBlock:^(NSURL *url, 
FVProgressIndicator *progressIndicator, BOOL *stop){
         NSUInteger anIndex = [progressIndicator indexInView];
         if ([_orderedURLs containsObject:url] == NO) {
@@ -1786,6 +1788,19 @@
     }];
 }
 
+- (void)_updateDownloadIndexes;
+{
+    for (FVDownload *download in _downloads) {
+        NSUInteger anIndex = [download indexInView];
+        NSURL *url = [download downloadURL];
+        if (anIndex >= [self numberOfIcons] || [[self URLAtIndex:anIndex] 
isEqual:url] == NO) {
+            anIndex = [_orderedURLs indexOfObject:url];
+            if (anIndex != NSNotFound)
+                [download setIndexInView:anIndex];
+        }
+    }
+}
+
 - (void)_resetViewLayout;
 {
     // When the tracking rects are active while the view is layed out, 
mouseEntered may be called even if the mouse does not move.  So we remove them 
before doing the layout.  We will reinstall them at the end of this method.
@@ -1980,6 +1995,8 @@
     
     [self _updateProgressIndicatorIndexes];
     
+    [self _updateDownloadIndexes];
+    
     [self _resetViewLayout];
     
     _fvFlags.needsReload = 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

Reply via email to