Revision: 29636
http://sourceforge.net/p/bibdesk/svn/29636
Author: hofman
Date: 2025-09-28 14:40:25 +0000 (Sun, 28 Sep 2025)
Log Message:
-----------
don't retain search index, it is retained by the array and also immediately
retained when used
Modified Paths:
--------------
trunk/bibdesk/BDSKItemSearchIndexes.h
trunk/bibdesk/BDSKItemSearchIndexes.m
trunk/bibdesk/BDSKPublicationsArray.h
trunk/bibdesk/BDSKPublicationsArray.m
trunk/bibdesk/BibDocument_Search.m
Modified: trunk/bibdesk/BDSKItemSearchIndexes.h
===================================================================
--- trunk/bibdesk/BDSKItemSearchIndexes.h 2025-09-27 16:32:12 UTC (rev
29635)
+++ trunk/bibdesk/BDSKItemSearchIndexes.h 2025-09-28 14:40:25 UTC (rev
29636)
@@ -49,7 +49,7 @@
- (void)removePublications:(NSArray *)pubs;
- (void)addPublications:(NSArray *)pubs;
-- (nullable SKIndexRef)copyIndexForField:(NSString *)field;
+- (nullable SKIndexRef)indexForField:(NSString *)field
NS_RETURNS_INNER_POINTER;
- (void)reset;
Modified: trunk/bibdesk/BDSKItemSearchIndexes.m
===================================================================
--- trunk/bibdesk/BDSKItemSearchIndexes.m 2025-09-27 16:32:12 UTC (rev
29635)
+++ trunk/bibdesk/BDSKItemSearchIndexes.m 2025-09-28 14:40:25 UTC (rev
29636)
@@ -189,9 +189,9 @@
}
}
-- (SKIndexRef)copyIndexForField:(NSString *)field {
+- (SKIndexRef)indexForField:(NSString *)field {
NSParameterAssert(nil != field);
- SKIndexRef anIndex =
(SKIndexRef)CFRetain(CFDictionaryGetValue(searchIndexes, (CFStringRef)field));
+ SKIndexRef anIndex = (SKIndexRef)CFDictionaryGetValue(searchIndexes,
(CFStringRef)field);
if (CFSetContainsValue(indexesToFlush, anIndex)) {
SKIndexFlush(anIndex);
CFSetRemoveValue(indexesToFlush, anIndex);
Modified: trunk/bibdesk/BDSKPublicationsArray.h
===================================================================
--- trunk/bibdesk/BDSKPublicationsArray.h 2025-09-27 16:32:12 UTC (rev
29635)
+++ trunk/bibdesk/BDSKPublicationsArray.h 2025-09-28 14:40:25 UTC (rev
29636)
@@ -66,7 +66,7 @@
- (nullable BibItem *)itemForIdentifierURL:(NSURL *)aURL;
- (nullable NSArray *)itemsForIdentifierURLs:(NSArray *)anArray;
-- (nullable SKIndexRef)copyIndexForField:(NSString *)field;
+- (nullable SKIndexRef)indexForField:(NSString *)field
NS_RETURNS_INNER_POINTER;
- (void)reindexPublications:(NSArray *)items;
Modified: trunk/bibdesk/BDSKPublicationsArray.m
===================================================================
--- trunk/bibdesk/BDSKPublicationsArray.m 2025-09-27 16:32:12 UTC (rev
29635)
+++ trunk/bibdesk/BDSKPublicationsArray.m 2025-09-28 14:40:25 UTC (rev
29636)
@@ -310,8 +310,8 @@
#pragma mark Search indexes
-- (SKIndexRef)copyIndexForField:(NSString *)field {
- return [searchIndexes copyIndexForField:field];
+- (SKIndexRef)indexForField:(NSString *)field {
+ return [searchIndexes indexForField:field];
}
- (void)reindexPublications:(NSArray *)items {
Modified: trunk/bibdesk/BibDocument_Search.m
===================================================================
--- trunk/bibdesk/BibDocument_Search.m 2025-09-27 16:32:12 UTC (rev 29635)
+++ trunk/bibdesk/BibDocument_Search.m 2025-09-28 14:40:25 UTC (rev 29636)
@@ -198,15 +198,14 @@
if ([field isEqualToString:BDSKSkimNotesString])
skIndex = [notesSearchIndex copyIndex];
else if ([self hasGroupTypeSelected:BDSKExternalGroupType])
- skIndex = [[[[self selectedGroups] firstObject] publications]
copyIndexForField:field];
+ skIndex = [[[[self selectedGroups] firstObject] publications]
indexForField:field];
else
- skIndex = [publications copyIndexForField:field];
+ skIndex = [publications indexForField:field];
if (skIndex) {
if (documentSearch == nil)
documentSearch = [[BDSKDocumentSearch alloc]
initWithDelegate:self];
[documentSearch
searchForString:BDSKSearchKitExpressionWithString(searchString) index:skIndex
selectedPublications:pubsToSelect scrollPositionAsPercentage:[tableView
scrollPositionAsPercentage]];
- CFRelease(skIndex);
} else {
// the index can be nil when the external group has no
publications
[shownPublications removeAllObjects];
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