Revision: 29861
http://sourceforge.net/p/bibdesk/svn/29861
Author: hofman
Date: 2025-11-20 17:31:03 +0000 (Thu, 20 Nov 2025)
Log Message:
-----------
make coding unavailable in external and parent groups, also does not need
coding for data classes for external groups
Modified Paths:
--------------
trunk/bibdesk/BDSKCondition.h
trunk/bibdesk/BDSKCondition.m
trunk/bibdesk/BDSKExternalGroup.h
trunk/bibdesk/BDSKExternalGroup.m
trunk/bibdesk/BDSKFilter.h
trunk/bibdesk/BDSKFilter.m
trunk/bibdesk/BDSKParentGroup.h
trunk/bibdesk/BDSKParentGroup.m
trunk/bibdesk/BDSKScriptGroup.h
trunk/bibdesk/BDSKScriptGroup.m
trunk/bibdesk/BDSKSearchGroup.h
trunk/bibdesk/BDSKSearchGroup.m
trunk/bibdesk/BDSKServerInfo.h
trunk/bibdesk/BDSKServerInfo.m
trunk/bibdesk/BDSKURLGroup.h
trunk/bibdesk/BDSKURLGroup.m
Modified: trunk/bibdesk/BDSKCondition.h
===================================================================
--- trunk/bibdesk/BDSKCondition.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKCondition.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -97,7 +97,7 @@
@protocol BDSKSmartGroup;
@class BibItem, BibAuthor;
-@interface BDSKCondition : NSObject <NSCopying, NSSecureCoding> {
+@interface BDSKCondition : NSObject <NSCopying> {
NSString *key;
BDSKStringComparison stringComparison;
BDSKAttachmentComparison attachmentComparison;
@@ -119,7 +119,6 @@
@property (class, nonatomic, readonly) NSString *dictionaryVersion;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property (nonatomic, readonly) NSDictionary *dictionaryValue;
Modified: trunk/bibdesk/BDSKCondition.m
===================================================================
--- trunk/bibdesk/BDSKCondition.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKCondition.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -137,43 +137,6 @@
return self;
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super init];
- if (self) {
- key = [decoder decodeObjectOfClass:[NSString class] forKey:@"key"] ?:
@"";
- stringValue = @"";
- stringComparison = BDSKContain;
- attachmentComparison = BDSKCountNotEqual;
- countValue = 0;
- dateComparison = BDSKToday;
- numberValue = 0;
- andNumberValue = 0;
- periodValue = BDSKPeriodDay;
- dateValue = nil;
- toDateValue = nil;
- authorValue = nil;
- group = nil;
- cachedStartDate = nil;
- cachedEndDate = nil;
- cacheTimer = nil;
- // the order is important
- [self setComparison:[decoder
decodeIntegerForKey:@"comparison"]];
- if ([self isDateCondition] || [self isAttachmentCondition])
- [self setDefaultValue];
- [self setValue:[decoder decodeObjectOfClass:[NSString class]
forKey:@"value"]];
- BDSKASSERT([self value] != nil);
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [coder encodeObject:[self key] forKey:@"key"];
- [coder encodeInteger:[self comparison] forKey:@"comparison"];
- [coder encodeObject:[self value] forKey:@"value"];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (void)dealloc {
//NSLog(@"dealloc condition");
[cacheTimer invalidate];
Modified: trunk/bibdesk/BDSKExternalGroup.h
===================================================================
--- trunk/bibdesk/BDSKExternalGroup.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKExternalGroup.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -51,6 +51,9 @@
BDSKMacroResolver *macroResolver;
}
+- (instancetype)initWithName:(NSString *)aName NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
+
@property (nonatomic, readonly) NSString *name;
- (void)refresh;
Modified: trunk/bibdesk/BDSKExternalGroup.m
===================================================================
--- trunk/bibdesk/BDSKExternalGroup.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKExternalGroup.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -65,11 +65,7 @@
- (instancetype)initWithCoder:(NSCoder *)decoder {
BDSKASSERT_NOT_REACHED("External groups should never be decoded");
- self = [super initWithCoder:decoder];
- if (self) {
- publications = nil;
- macroResolver = [[BDSKMacroResolver alloc] initWithOwner:self];
- }
+ self = nil;
return self;
}
@@ -78,8 +74,6 @@
[super encodeWithCoder:coder];
}
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (void)dealloc {
// should always be on the main thread, see BibDocument, but be sure
BDSKENSURE_MAIN_THREAD(
Modified: trunk/bibdesk/BDSKFilter.h
===================================================================
--- trunk/bibdesk/BDSKFilter.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKFilter.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -48,7 +48,7 @@
@protocol BDSKSmartGroup;
@class BDSKCondition, BibItem;
-@interface BDSKFilter : NSObject <NSCopying, NSSecureCoding> {
+@interface BDSKFilter : NSObject <NSCopying> {
NSMutableArray *conditions;
BDSKConjunction conjunction;
__weak id<BDSKSmartGroup> group;
@@ -57,7 +57,6 @@
- (instancetype)initWithConditions:(NSArray *)aConditions
conjunction:(BDSKConjunction)aConjunction NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly) NSDictionary *dictionaryValue;
Modified: trunk/bibdesk/BDSKFilter.m
===================================================================
--- trunk/bibdesk/BDSKFilter.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKFilter.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -81,23 +81,6 @@
return [self initWithConditions:newConditions conjunction:[[dictionary
objectForKey:@"conjunction"] integerValue]];
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super init];
- if (self) {
- conditions = [[NSMutableArray alloc] initWithArray:[decoder
decodeObjectOfClasses:[NSSet setWithObjects:[NSArray class], [BDSKCondition
class], nil] forKey:@"conditions"]];
- conjunction = [decoder decodeIntegerForKey:@"conjunction"];
- group = nil;
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [coder encodeObject:conditions forKey:@"conditions"];
- [coder encodeInteger:conjunction forKey:@"conjunction"];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (void)dealloc {
if (group)
BDSKENSURE_MAIN_THREAD(
Modified: trunk/bibdesk/BDSKParentGroup.h
===================================================================
--- trunk/bibdesk/BDSKParentGroup.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKParentGroup.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -48,6 +48,9 @@
NSArray *sortDescriptors;
}
+- (instancetype)initWithName:(NSString *)aName NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithCoder:(NSCoder *)coderr NS_UNAVAILABLE;
+
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSString *identifier;
@@ -105,7 +108,6 @@
}
- (instancetype)initWithKey:(NSString *)aKey NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithCoder:(NSCoder *)coderr NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithName:(NSString *)aName NS_UNAVAILABLE;
@property (nonatomic, strong) NSArray *categoryGroups;
Modified: trunk/bibdesk/BDSKParentGroup.m
===================================================================
--- trunk/bibdesk/BDSKParentGroup.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKParentGroup.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -66,10 +66,7 @@
- (instancetype)initWithCoder:(NSCoder *)decoder {
BDSKASSERT_NOT_REACHED("Parent groups should never be decoded");
- self = [super initWithCoder:decoder];
- if (self) {
- children = [[NSMutableArray alloc] init];
- }
+ self = nil;
return self;
}
@@ -341,21 +338,6 @@
return self;
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super initWithCoder:decoder];
- if (self) {
- key = [decoder decodeObjectOfClass:[NSString class] forKey:@"key"];
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [super encodeWithCoder:coder];
- [coder encodeObject:key forKey:@"key"];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (BDSKGroupType)groupType { return BDSKCategoryParentGroupType; }
// category parents aren't unique, so we need to use a different identifier
for remembering expanded state
Modified: trunk/bibdesk/BDSKScriptGroup.h
===================================================================
--- trunk/bibdesk/BDSKScriptGroup.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKScriptGroup.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -62,7 +62,6 @@
- (instancetype)initWithScriptPath:(NSString *)path scriptArguments:(nullable
NSString *)arguments;
- (instancetype)initWithName:(nullable NSString *)aName scriptPath:(NSString
*)path scriptArguments:(nullable NSString *)arguments
scriptType:(BDSKScriptType)type NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithName:(NSString *)aName NS_UNAVAILABLE;
@property (nonatomic, strong) NSString *scriptPath;
Modified: trunk/bibdesk/BDSKScriptGroup.m
===================================================================
--- trunk/bibdesk/BDSKScriptGroup.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKScriptGroup.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -132,26 +132,6 @@
return [NSDictionary dictionaryWithObjectsAndKeys:aName, @"group name",
aPath, @"script path", anArgs, @"script arguments", aType, @"script type", nil];
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super initWithCoder:decoder];
- if (self) {
- scriptPath = [decoder decodeObjectOfClass:[NSString class]
forKey:@"scriptPath"];
- scriptArguments = [decoder decodeObjectOfClass:[NSString class]
forKey:@"scriptArguments"];
- scriptType = [decoder decodeIntegerForKey:@"scriptType"];
- [self commonInit];
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [super encodeWithCoder:coder];
- [coder encodeObject:scriptPath forKey:@"scriptPath"];
- [coder encodeObject:scriptArguments forKey:@"scriptArguments"];
- [coder encodeInteger:scriptType forKey:@"scriptType"];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (id)copyWithZone:(NSZone *)aZone {
return [[[self class] alloc] initWithName:name scriptPath:scriptPath
scriptArguments:scriptArguments scriptType:scriptType];
}
Modified: trunk/bibdesk/BDSKSearchGroup.h
===================================================================
--- trunk/bibdesk/BDSKSearchGroup.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKSearchGroup.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -77,7 +77,6 @@
}
- (instancetype)initWithServerInfo:(BDSKServerInfo *)info searchTerm:(nullable
NSString *)string NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithURL:(NSURL *)bdsksearchURL;
@property (nonatomic, readonly) NSString *type;
Modified: trunk/bibdesk/BDSKSearchGroup.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroup.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKSearchGroup.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -160,28 +160,6 @@
return groupDict;
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super initWithCoder:decoder];
- if (self) {
- searchTerm = [decoder decodeObjectOfClass:[NSString class]
forKey:@"searchTerm"];
-
- history = nil;
-
- server = [[self class] copyServerWithGroup:self serverInfo:[decoder
decodeObjectOfClass:[BDSKServerInfo class] forKey:@"serverInfo"]];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillTerminate:)
name:NSApplicationWillTerminateNotification object:nil];
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [super encodeWithCoder:coder];
- [coder encodeObject:searchTerm forKey:@"searchTerm"];
- [coder encodeObject:[self serverInfo] forKey:@"serverInfo"];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (id)copyWithZone:(NSZone *)aZone {
return [[[self class] alloc] initWithServerInfo:[self serverInfo]
searchTerm:searchTerm];
}
Modified: trunk/bibdesk/BDSKServerInfo.h
===================================================================
--- trunk/bibdesk/BDSKServerInfo.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKServerInfo.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -50,7 +50,7 @@
@class BDSKReadWriteLock;
-@interface BDSKServerInfo : NSObject <NSCopying, NSMutableCopying,
NSSecureCoding> {
+@interface BDSKServerInfo : NSObject <NSCopying, NSMutableCopying> {
NSString *type;
NSString *name;
NSString *database;
@@ -65,7 +65,6 @@
+ (nullable instancetype)defaultServerInfoWithType:(NSString *)aType;
- (nullable instancetype)initWithType:(NSString *)aType name:(NSString *)aName
database:(NSString *)aDbase host:(nullable NSString *)aHost port:(nullable
NSString *)aPort options:(nullable NSDictionary *)options
NS_DESIGNATED_INITIALIZER;
-- (nullable instancetype)initWithCoder:(NSCoder *)coder
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
- (nullable instancetype)initWithDictionary:(NSDictionary *)info;
Modified: trunk/bibdesk/BDSKServerInfo.m
===================================================================
--- trunk/bibdesk/BDSKServerInfo.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKServerInfo.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -148,47 +148,6 @@
return self;
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super init];
- if (self) {
- type = [decoder decodeObjectOfClass:[NSString class] forKey:TYPE_KEY];
- name = [decoder decodeObjectOfClass:[NSString class] forKey:NAME_KEY];
- database = [decoder decodeObjectOfClass:[NSString class]
forKey:DATABASE_KEY];
- passwordInKeychain = NO;
- if ([self isKindOfClass:[BDSKMutableServerInfo class]] == NO)
- passwordLock = [[BDSKReadWriteLock alloc] init];
- if ([self isEntrez] || [self isISI] || [self isDBLP]) {
- host = nil;
- port = nil;
- options = [[decoder decodeObjectOfClasses:[NSSet
setWithObjects:[NSDictionary class], [NSString class], nil] forKey:OPTIONS_KEY]
mutableCopy];
- if ([options count] == 0)
- options = nil;
- password = [[options objectForKey:PASSWORD_KEY] copy];
- [options removeObjectForKey:PASSWORD_KEY];
- } else if ([self isZoom] || [self isSRU]) {
- host = [decoder decodeObjectOfClass:[NSString class]
forKey:HOST_KEY];
- port = [decoder decodeObjectOfClass:[NSString class]
forKey:PORT_KEY];
- options = [[decoder decodeObjectOfClasses:[NSSet
setWithObjects:[NSDictionary class], [NSString class], nil] forKey:OPTIONS_KEY]
mutableCopy];
- password = [[options objectForKey:PASSWORD_KEY] copy];
- [options removeObjectForKey:PASSWORD_KEY];
- } else {
- self = nil;
- }
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [coder encodeObject:type forKey:TYPE_KEY];
- [coder encodeObject:name forKey:NAME_KEY];
- [coder encodeObject:database forKey:DATABASE_KEY];
- [coder encodeObject:host forKey:HOST_KEY];
- [coder encodeObject:port forKey:PORT_KEY];
- [coder encodeObject:options forKey:OPTIONS_KEY];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (id)copyWithZone:(NSZone *)aZone {
[passwordLock lockForReading];
id copy = [[BDSKServerInfo alloc] initWithType:[self type] name:[self
name] database:[self database] host:[self host] port:[self port]
options:options password:password passwordInKeychain:passwordInKeychain];
@@ -433,16 +392,6 @@
return self;
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super initWithCoder:decoder];
- if (self) {
- passwordLock = nil;
- }
- return self;
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
// When changing the type, all data must be properly updated to be valid,
taking into account the condition implict in the validation methods
- (void)setType:(NSString *)newType {
if ([type isEqualToString:newType] == NO) {
Modified: trunk/bibdesk/BDSKURLGroup.h
===================================================================
--- trunk/bibdesk/BDSKURLGroup.h 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKURLGroup.h 2025-11-20 17:31:03 UTC (rev 29861)
@@ -53,7 +53,6 @@
- (instancetype)initWithName:(nullable NSString *)aName URL:(NSURL *)aURL
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithURL:(NSURL *)aURL;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithName:(NSString *)aName NS_UNAVAILABLE;
@property (nonatomic, strong) NSURL *URL;
Modified: trunk/bibdesk/BDSKURLGroup.m
===================================================================
--- trunk/bibdesk/BDSKURLGroup.m 2025-11-20 16:51:56 UTC (rev 29860)
+++ trunk/bibdesk/BDSKURLGroup.m 2025-11-20 17:31:03 UTC (rev 29861)
@@ -97,25 +97,6 @@
return [NSDictionary dictionaryWithObjectsAndKeys:aName, @"group name",
anURL, @"URL", nil];
}
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super initWithCoder:decoder];
- if (self) {
- URL = [decoder decodeObjectOfClass:[NSURL class] forKey:@"URL"];
-
- isRetrieving = NO;
- failedDownload = NO;
- download = nil;
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [super encodeWithCoder:coder];
- [coder encodeObject:URL forKey:@"URL"];
-}
-
-+ (BOOL)supportsSecureCoding { return YES; }
-
- (id)copyWithZone:(NSZone *)aZone {
return [[[self class] alloc] initWithName:name URL:URL];
}
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