Revision: 27978
          http://sourceforge.net/p/bibdesk/svn/27978
Author:   hofman
Date:     2022-10-01 21:00:30 +0000 (Sat, 01 Oct 2022)
Log Message:
-----------
suppress default server when setting custom under a new name

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

Modified: trunk/bibdesk/BDSKSearchGroupServerManager.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroupServerManager.m        2022-10-01 09:34:36 UTC 
(rev 27977)
+++ trunk/bibdesk/BDSKSearchGroupServerManager.m        2022-10-01 21:00:30 UTC 
(rev 27978)
@@ -201,8 +201,14 @@
 }
 
 - (void)setServer:(BDSKServerInfo *)serverInfo atIndex:(NSUInteger)idx {
+    BDSKServerInfo *oldServerInfo = [searchGroupServers objectAtIndex:idx];
+    if ([[oldServerInfo name] isEqualToString:[serverInfo name]] == NO) {
+        if ([defaultSearchGroupServerNames containsObject:[oldServerInfo 
name]])
+            [self saveServerFile:oldServerInfo forSuppression:YES];
+        else
+            [self deleteServerFile:oldServerInfo];
+    }
     // this also makes sure any password is saved in the keychain
-    [self deleteServerFile:[searchGroupServers objectAtIndex:idx]];
     [self saveServerFile:serverInfo forSuppression:NO];
     [searchGroupServers replaceObjectAtIndex:idx withObject:[[serverInfo copy] 
autorelease]];
     [searchGroupServers sortUsingDescriptors:sortDescriptors];

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

Reply via email to