Revision: 27576
          http://sourceforge.net/p/bibdesk/svn/27576
Author:   hofman
Date:     2022-06-07 14:50:58 +0000 (Tue, 07 Jun 2022)
Log Message:
-----------
run through downloads only once

Modified Paths:
--------------
    trunk/bibdesk/BibItem.m

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2022-06-07 14:09:47 UTC (rev 27575)
+++ trunk/bibdesk/BibItem.m     2022-06-07 14:50:58 UTC (rev 27576)
@@ -2758,16 +2758,14 @@
     
     [[[self undoManager] prepareWithInvocationTarget:self] 
insertFiles:oldFiles atIndexes:aSet];
     
-    for (BDSKLinkedFile *file in oldFiles) {
+    for (BDSKLinkedFile *file in oldFiles)
         [self removeFileToBeFiled:file];
-        
-        for (BDSKItemDownload *download in [[downloads copy] autorelease]) {
-            if ([download linkedFile] == file) {
-                [download cancel];
-                NSDictionary *userInfo = [NSDictionary 
dictionaryWithObject:download forKey:BDSKItemDownloadKey];
-                [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKItemDownloadFinishedNotification object:self 
userInfo:userInfo];
-                [downloads removeObject:download];
-            }
+    for (BDSKItemDownload *download in [[downloads copy] autorelease]) {
+        if ([oldFiles containsObject:[download linkedFile]]) {
+            [download cancel];
+            NSDictionary *userInfo = [NSDictionary 
dictionaryWithObject:download forKey:BDSKItemDownloadKey];
+            [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKItemDownloadFinishedNotification object:self 
userInfo:userInfo];
+            [downloads removeObject:download];
         }
     }
     

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