Revision: 28988 http://sourceforge.net/p/bibdesk/svn/28988 Author: hofman Date: 2025-02-06 15:55:47 +0000 (Thu, 06 Feb 2025) Log Message: ----------- remove support for synchronous webgroup and searchgroup search for items
Modified Paths: -------------- trunk/bibdesk/BDSKSearchGroup.h trunk/bibdesk/BDSKSearchGroup.m trunk/bibdesk/BDSKWebGroup.h trunk/bibdesk/BDSKWebGroup.m Modified: trunk/bibdesk/BDSKSearchGroup.h =================================================================== --- trunk/bibdesk/BDSKSearchGroup.h 2025-02-06 15:46:20 UTC (rev 28987) +++ trunk/bibdesk/BDSKSearchGroup.h 2025-02-06 15:55:47 UTC (rev 28988) @@ -108,9 +108,9 @@ id strongSelf; } -+ (NSArray *)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler; ++ (void)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler; - (instancetype)initWithMacroResolver:(BDSKMacroResolver *)aMacroResolver; -- (NSArray *)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo completionHandler:(void(^)(NSArray *publications))aCompletionHandler; +- (void)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo completionHandler:(void(^)(NSArray *publications))aCompletionHandler; @end Modified: trunk/bibdesk/BDSKSearchGroup.m =================================================================== --- trunk/bibdesk/BDSKSearchGroup.m 2025-02-06 15:46:20 UTC (rev 28987) +++ trunk/bibdesk/BDSKSearchGroup.m 2025-02-06 15:55:47 UTC (rev 28988) @@ -445,17 +445,15 @@ return self; } -+ (NSArray *)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler { ++ (void)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler { if (serverInfo == nil) { - if (completionHandler == NULL) - return [BDSKEntrezGroupServer itemsForSearchTerm:searchTerm usingDatabase:@"pubmed" allowMultiple:YES]; serverInfo = [[BDSKServerInfo alloc] initWithType:BDSKSearchGroupEntrez name:@"PubMed" database:@"pubmed" host:nil port:nil options:nil]; } BDSKGroupSearch *search = [[self alloc] initWithMacroResolver:macroResolver]; - return [search searchUsingSearchTerm:searchTerm serverInfo:serverInfo completionHandler:completionHandler]; + [search searchUsingSearchTerm:searchTerm serverInfo:serverInfo completionHandler:completionHandler]; } -- (NSArray *)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo completionHandler:(void(^)(NSArray *publications))aCompletionHandler { +- (void)searchUsingSearchTerm:(NSString *)searchTerm serverInfo:(BDSKServerInfo *)serverInfo completionHandler:(void(^)(NSArray *publications))aCompletionHandler { server = [BDSKSearchGroup copyServerWithGroup:self serverInfo:serverInfo]; completionHandler = [aCompletionHandler copy]; @@ -462,23 +460,9 @@ importFinished = NO; - BOOL async = completionHandler != NULL; - strongSelf = self; [server retrieveWithSearchTerm:searchTerm]; - - if (async) - return nil; - - NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; - while (importFinished == NO && [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]); - - NSArray *pubs = [publications count] > 0 ? [publications copy] : nil; - - strongSelf = nil; - - return pubs; } #pragma mark BDSKSearchGroup protocol Modified: trunk/bibdesk/BDSKWebGroup.h =================================================================== --- trunk/bibdesk/BDSKWebGroup.h 2025-02-06 15:46:20 UTC (rev 28987) +++ trunk/bibdesk/BDSKWebGroup.h 2025-02-06 15:55:47 UTC (rev 28988) @@ -67,6 +67,6 @@ id strongSelf; } -+ (NSArray *)itemsFromURL:(NSURL *)aURL macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler; ++ (void)itemsFromURL:(NSURL *)aURL macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler; @end Modified: trunk/bibdesk/BDSKWebGroup.m =================================================================== --- trunk/bibdesk/BDSKWebGroup.m 2025-02-06 15:46:20 UTC (rev 28987) +++ trunk/bibdesk/BDSKWebGroup.m 2025-02-06 15:55:47 UTC (rev 28988) @@ -413,7 +413,7 @@ } } -- (NSArray *)itemsFromURL:(NSURL *)aURL completionHandler:(void(^)(NSArray *publications))aCompletionHandler { +- (void)itemsFromURL:(NSURL *)aURL completionHandler:(void(^)(NSArray *publications))aCompletionHandler { completionHandler = [aCompletionHandler copy]; @@ -421,32 +421,15 @@ [group setURL:aURL]; - if (completionHandler != NULL) { - - if ([group isRetrieving]) - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleGroupUpdatedNotification:) name:BDSKExternalGroupUpdatedNotification object:group]; - else - [self handleGroupUpdatedNotification:nil]; - - return nil; - - } else { - - NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; - while ([group isRetrieving] && [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]); - - NSArray *pubs = [self publications]; - - strongSelf = nil; - - return pubs; - - } + if ([group isRetrieving]) + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleGroupUpdatedNotification:) name:BDSKExternalGroupUpdatedNotification object:group]; + else + [self handleGroupUpdatedNotification:nil]; } -+ (NSArray *)itemsFromURL:(NSURL *)aURL macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler { ++ (void)itemsFromURL:(NSURL *)aURL macroResolver:(BDSKMacroResolver *)macroResolver completionHandler:(void(^)(NSArray *publications))completionHandler { BDSKWebSearch *search = [[self alloc] initWithMacroResolver:macroResolver]; - return [search itemsFromURL:aURL completionHandler:completionHandler]; + [search itemsFromURL:aURL completionHandler:completionHandler]; } @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit