Revision: 29559
http://sourceforge.net/p/bibdesk/svn/29559
Author: hofman
Date: 2025-09-08 16:27:33 +0000 (Mon, 08 Sep 2025)
Log Message:
-----------
check dowwnload status before cancel or remove
Modified Paths:
--------------
trunk/bibdesk/BDSKDownloadManager.m
Modified: trunk/bibdesk/BDSKDownloadManager.m
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.m 2025-09-08 16:20:52 UTC (rev 29558)
+++ trunk/bibdesk/BDSKDownloadManager.m 2025-09-08 16:27:33 UTC (rev 29559)
@@ -145,16 +145,19 @@
}
- (void)cancel:(NSInteger)uniqueID {
- id download = [[self downloadWithUniqueID:uniqueID] download];
- if ([download respondsToSelector:@selector(cancel)])
- [download cancel];
- else if (@available(macOS 11.3, *))
- [(WKDownload *)download cancel:nil];
+ BDSKWebDownload *webDownload = [self downloadWithUniqueID:uniqueID];
+ if (webDownload && [webDownload status] == BDSKDownloadStatusDownloading) {
+ id download = [webDownload download];
+ if ([download respondsToSelector:@selector(cancel)])
+ [download cancel];
+ else if (@available(macOS 11.3, *))
+ [(WKDownload *)download cancel:nil];
+ }
}
- (void)remove:(NSInteger)uniqueID {
BDSKWebDownload *webDownload = [self downloadWithUniqueID:uniqueID];
- if (webDownload) {
+ if (webDownload && [webDownload status] != BDSKDownloadStatusDownloading) {
[downloads removeObject:webDownload];
[self notifyUpdate];
}
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