Revision: 29534
http://sourceforge.net/p/bibdesk/svn/29534
Author: hofman
Date: 2025-09-05 16:23:38 +0000 (Fri, 05 Sep 2025)
Log Message:
-----------
use signed integer consistent with type in javascript where it is used
Modified Paths:
--------------
trunk/bibdesk/BDSKDownloadManager.h
trunk/bibdesk/BDSKDownloadManager.m
Modified: trunk/bibdesk/BDSKDownloadManager.h
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.h 2025-09-05 16:18:11 UTC (rev 29533)
+++ trunk/bibdesk/BDSKDownloadManager.h 2025-09-05 16:23:38 UTC (rev 29534)
@@ -72,11 +72,9 @@
@property (nonatomic) BOOL removeFinishedDownloads, removeFailedDownloads;
- (void)clear;
-- (void)cancel:(NSUInteger)uniqueID;
-- (void)remove:(NSUInteger)uniqueID;
+- (void)cancel:(NSInteger)uniqueID;
+- (void)remove:(NSInteger)uniqueID;
-- (void)performAction:(NSString *)action withValue:(NSInteger)value;
-
- (void)addDownload:(id)download;
@end
@@ -84,7 +82,7 @@
#pragma mark -
@interface BDSKWebDownload : NSObject {
- NSUInteger uniqueID;
+ NSInteger uniqueID;
NSURL *URL;
NSURL *fileURL;
BDSKDownloadStatus status;
@@ -95,7 +93,7 @@
- (instancetype)initWithDownload:(id)aDownload URL:(NSURL *)aURL;
@property (nonatomic, readonly) id download;
-@property (nonatomic, readonly) NSUInteger uniqueID;
+@property (nonatomic, readonly) NSInteger uniqueID;
@property (nonatomic, readonly) NSURL *URL;
@property (nonatomic, nullable, strong) NSURL *fileURL;
@property (nonatomic, nullable, readonly) NSString *fileName;
Modified: trunk/bibdesk/BDSKDownloadManager.m
===================================================================
--- trunk/bibdesk/BDSKDownloadManager.m 2025-09-05 16:18:11 UTC (rev 29533)
+++ trunk/bibdesk/BDSKDownloadManager.m 2025-09-05 16:23:38 UTC (rev 29534)
@@ -99,7 +99,7 @@
return nil;
}
-- (BDSKWebDownload *)downloadWithUniqueID:(NSUInteger)uniqueID {
+- (BDSKWebDownload *)downloadWithUniqueID:(NSInteger)uniqueID {
for (BDSKWebDownload *webDownload in downloads) {
if ([webDownload uniqueID] == uniqueID)
return webDownload;
@@ -120,11 +120,11 @@
[self notifyUpdate];
}
-- (void)cancel:(NSUInteger)uniqueID {
+- (void)cancel:(NSInteger)uniqueID {
[[self downloadWithUniqueID:uniqueID] cancel];
}
-- (void)remove:(NSUInteger)uniqueID {
+- (void)remove:(NSInteger)uniqueID {
BDSKWebDownload *webDownload = [self downloadWithUniqueID:uniqueID];
if (webDownload) {
[downloads removeObject:webDownload];
@@ -154,34 +154,6 @@
return @[@"removeFinishedDownloads", @"removeFailedDownloads"];
}
-
-- (void)performAction:(NSString *)action withValue:(NSInteger)value {
- if ([action isEqualToString:@"cancel"]) {
- [[self downloadWithUniqueID:value] cancel];
- } else if ([action isEqualToString:@"remove"]) {
- BDSKWebDownload *webDownload = [self downloadWithUniqueID:value];
- if (webDownload) {
- [downloads removeObject:webDownload];
- [self notifyUpdate];
- }
- } else if ([action isEqualToString:@"clear"]) {
- BOOL didRemove = NO;
- NSUInteger i = [downloads count];
- while (i--) {
- if ([[downloads objectAtIndex:i] status] !=
BDSKDownloadStatusDownloading) {
- [downloads removeObjectAtIndex:i];
- didRemove = YES;
- }
- }
- if (didRemove)
- [self notifyUpdate];
- } else if ([action isEqualToString:@"removeFinished"]) {
- [[NSUserDefaults standardUserDefaults] setBool:value
forKey:BDSKRemoveFinishedDownloadsKey];
- } else if ([action isEqualToString:@"removeFailed"]) {
- [[NSUserDefaults standardUserDefaults] setBool:value
forKey:BDSKRemoveFailedDownloadsKey];
- }
-}
-
- (NSString *)fontFamilyName { return [[NSFont systemFontOfSize:0.0]
familyName]; }
#pragma mark NSURLDownload delegate protocol
@@ -406,7 +378,7 @@
@synthesize download, uniqueID, URL, fileURL, status, response;
@dynamic fileName;
-static NSUInteger currentUniqueID = 0;
+static NSInteger currentUniqueID = 0;
- (instancetype)initWithDownload:(id)aDownload URL:(NSURL *)aURL {
self = [super init];
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