Revision: 29533
          http://sourceforge.net/p/bibdesk/svn/29533
Author:   hofman
Date:     2025-09-05 16:18:11 +0000 (Fri, 05 Sep 2025)
Log Message:
-----------
mark download as failed when canceling choosing download destination, 
consistent with other download types

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

Modified: trunk/bibdesk/BDSKDownloadManager.m
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.m 2025-09-05 16:10:00 UTC (rev 29532)
+++ trunk/bibdesk/BDSKDownloadManager.m 2025-09-05 16:18:11 UTC (rev 29533)
@@ -219,16 +219,35 @@
             NSURL *fileURL = [sPanel URL];
             if ([fileURL checkResourceIsReachableAndReturnError:NULL])
                 [[NSFileManager defaultManager] removeItemAtURL:fileURL 
error:NULL];
-            if ([[NSFileManager defaultManager] moveItemAtURL:[webDownload 
fileURL] toURL:fileURL error:NULL])
+            if ([[NSFileManager defaultManager] moveItemAtURL:[webDownload 
fileURL] toURL:fileURL error:NULL]) {
                 [webDownload setFileURL:fileURL];
+                
+                [webDownload setStatus:BDSKDownloadStatusFinished];
+                
+                if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKRemoveFinishedDownloadsKey] && webDownload)
+                    [downloads removeObject:webDownload];
+                [self notifyUpdate];
+            } else {
+                [webDownload setStatus:BDSKDownloadStatusFailed];
+                
+                if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKRemoveFailedDownloadsKey] && webDownload)
+                    [downloads removeObject:webDownload];
+                [self notifyUpdate];
+            }
+        } else {
+            [webDownload setStatus:BDSKDownloadStatusFailed];
+            
+            if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKRemoveFailedDownloadsKey] && webDownload)
+                [downloads removeObject:webDownload];
+            [self notifyUpdate];
         }
+    } else {
+        [webDownload setStatus:BDSKDownloadStatusFinished];
+        
+        if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKRemoveFinishedDownloadsKey] && webDownload)
+            [downloads removeObject:webDownload];
+        [self notifyUpdate];
     }
-    
-    [webDownload setStatus:BDSKDownloadStatusFinished];
-    
-    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKRemoveFinishedDownloadsKey] && webDownload)
-        [downloads removeObject:webDownload];
-    [self notifyUpdate];
 }
 
 - (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to