Revision: 29263
          http://sourceforge.net/p/bibdesk/svn/29263
Author:   hofman
Date:     2025-05-05 15:57:49 +0000 (Mon, 05 May 2025)
Log Message:
-----------
No separate method to create a new serverInfo, complete implementation is only 
needed in one place

Modified Paths:
--------------
    trunk/bibdesk/BDSKSearchGroup.m

Modified: trunk/bibdesk/BDSKSearchGroup.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroup.m     2025-05-05 14:41:16 UTC (rev 29262)
+++ trunk/bibdesk/BDSKSearchGroup.m     2025-05-05 15:57:49 UTC (rev 29263)
@@ -66,7 +66,6 @@
 
 @interface BDSKSearchGroup ()
 + (id<BDSKSearchGroupServer>)copyServerWithGroup:(id<BDSKSearchGroup>)group 
serverInfo:(BDSKServerInfo *)info;
-- (void)resetServerWithInfo:(BDSKServerInfo *)info;
 @end
 
 @implementation BDSKSearchGroup
@@ -108,7 +107,7 @@
         } else {
             searchTerm = [string copy];
             history = nil;
-            [self resetServerWithInfo:info];
+            server = [[self class] copyServerWithGroup:self serverInfo:info];
             [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(applicationWillTerminate:) 
name:NSApplicationWillTerminateNotification object:nil];
         }
     }
@@ -167,7 +166,7 @@
         
         history = nil;
         
-        [self resetServerWithInfo:[decoder decodeObjectForKey:@"serverInfo"]];
+        server = [[self class] copyServerWithGroup:self serverInfo:[decoder 
decodeObjectForKey:@"serverInfo"]];
         
         [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(applicationWillTerminate:) 
name:NSApplicationWillTerminateNotification object:nil];
     }
@@ -250,11 +249,6 @@
     [self notifyUpdate];
 }
 
-- (void)resetServerWithInfo:(BDSKServerInfo *)info {
-    [server terminate];
-    server = [[self class] copyServerWithGroup:self serverInfo:info];
-}
-
 - (void)search;
 {
     if ([self isRetrieving] == NO) {
@@ -279,10 +273,12 @@
 
 - (void)setServerInfo:(BDSKServerInfo *)info;
 {
-    if ([[info type] isEqualToString:[server type]] == NO)
-        [self resetServerWithInfo:info];
-    else
+    if ([[info type] isEqualToString:[server type]] == NO) {
+        [server terminate];
+        server = [[self class] copyServerWithGroup:self serverInfo:info];
+    } else {
         [server setServerInfo:info];
+    }
     [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKGroupNameChangedNotification object:self];
     [self reset];
 }

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

Reply via email to