Revision: 29802
http://sourceforge.net/p/bibdesk/svn/29802
Author: hofman
Date: 2025-11-14 15:48:58 +0000 (Fri, 14 Nov 2025)
Log Message:
-----------
No need to make tree nodes for file matcher support secure coding, as they are
never archived
Modified Paths:
--------------
trunk/bibdesk/BDSKFileMatcher.m
trunk/bibdesk/BDSKTreeNode.m
Modified: trunk/bibdesk/BDSKFileMatcher.m
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.m 2025-11-14 15:43:27 UTC (rev 29801)
+++ trunk/bibdesk/BDSKFileMatcher.m 2025-11-14 15:48:58 UTC (rev 29802)
@@ -73,7 +73,7 @@
#define SCORE_KEY @"score"
#define CHILDREN_KEY @"children"
-@interface BDSKMatchedFileNode : BDSKTreeNode <QLPreviewItem>
+@interface BDSKTreeNode (BDSKFileMatcher) <QLPreviewItem>
@end
@interface BDSKFileMatcher ()
@@ -383,7 +383,7 @@
NSMutableArray *nodes = [[NSMutableArray alloc] init];
for (BibItem *pub in pubs) {
- BDSKTreeNode *theNode = [[BDSKMatchedFileNode alloc] init];
+ BDSKTreeNode *theNode = [[BDSKTreeNode alloc] init];
// we add the pub to the tree so it's retained, but don't touch it in
the thread!
[theNode setValue:pub forKey:PUB_KEY];
@@ -464,7 +464,7 @@
// now we have a matching file; we could remove it from
the index, but multiple matches are reasonable
for (i = 0; i < iMax; i++) {
- BDSKTreeNode *child = [[BDSKMatchedFileNode alloc]
init];
+ BDSKTreeNode *child = [[BDSKTreeNode alloc] init];
[child setValue:(__bridge NSURL *)urls[i]
forKey:FILEURL_KEY];
[child setValue:[[(__bridge NSURL *)urls[i] path]
stringByAbbreviatingWithTildeInPath] forKey:STRING_KEY];
[child setValue:[[NSWorkspace sharedWorkspace]
iconForFile:[(__bridge NSURL *)urls[i] path]] forKey:IMAGE_KEY];
@@ -601,12 +601,8 @@
@end
-@implementation BDSKMatchedFileNode
+@implementation BDSKTreeNode (BDSKFileMatcher)
-+ (NSSet *)allowedColumnValueClasses {
- return [NSSet setWithObjects:[NSDictionary class], [NSString class],
[NSNumber class], [NSURL class], [NSImage class], [BibItem class], nil];
-}
-
- (NSURL *)previewItemURL {
return [self valueForKey:FILEURL_KEY];
}
Modified: trunk/bibdesk/BDSKTreeNode.m
===================================================================
--- trunk/bibdesk/BDSKTreeNode.m 2025-11-14 15:43:27 UTC (rev 29801)
+++ trunk/bibdesk/BDSKTreeNode.m 2025-11-14 15:48:58 UTC (rev 29802)
@@ -65,15 +65,11 @@
return [NSString stringWithFormat:@"%@: %@ parent object;\n\tvalues:
\"%@\"\n\tchildren: \"%@\"", [super description], parent?@"Has":@"No",
columnValues, children];
}
-+ (NSSet *)allowedColumnValueClasses {
- return [NSSet setWithObjects:[NSDictionary class], [NSString class],
[NSData class], nil];
-}
-
- (instancetype)initWithCoder:(NSCoder *)coder;
{
if(self = [super init]){
children = [[NSMutableArray alloc] initWithArray:[coder
decodeObjectOfClasses:[NSSet setWithObjects:[NSArray class], [BDSKTreeNode
class], nil] forKey:@"children"]];
- columnValues = [[NSMutableDictionary alloc] initWithDictionary:[coder
decodeObjectOfClasses:[[self class] allowedColumnValueClasses]
forKey:@"columnValues"]];
+ columnValues = [[NSMutableDictionary alloc] initWithDictionary:[coder
decodeObjectOfClasses:[NSSet setWithObjects:[NSDictionary class], [NSString
class], [NSData class], nil] forKey:@"columnValues"]];
parent = [coder decodeObjectOfClass:[BDSKTreeNode class]
forKey:@"parent"];
}
return self;
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