Revision: 29691
          http://sourceforge.net/p/bibdesk/svn/29691
Author:   hofman
Date:     2025-10-10 15:04:19 +0000 (Fri, 10 Oct 2025)
Log Message:
-----------
rename defaultServer to sharedServer as it is a singleton

Modified Paths:
--------------
    trunk/bibdesk/BDSKSharingBrowser.m
    trunk/bibdesk/BDSKSharingServer.h
    trunk/bibdesk/BDSKSharingServer.m
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/BibDocument_Actions.m
    trunk/bibdesk/BibPref_Sharing.m

Modified: trunk/bibdesk/BDSKSharingBrowser.m
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.m  2025-10-10 14:13:33 UTC (rev 29690)
+++ trunk/bibdesk/BDSKSharingBrowser.m  2025-10-10 15:04:19 UTC (rev 29691)
@@ -123,7 +123,7 @@
         return;
     // In general, we want to ignore our own shared services, although this 
doesn't cause problems with the run loop anymore (since the DO servers have 
their own threads)  Since SystemConfiguration guarantees that we have a unique 
computer name, this should be safe.
     if ([[aNetService name] isEqualToString:[BDSKSharingServer 
currentSharingName]] && [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKEnableSharingWithSelfKey] == NO) {
-        switch ([[BDSKSharingServer defaultServer] status]) {
+        switch ([[BDSKSharingServer sharedServer] status]) {
             case BDSKSharingStatusOff:
             case BDSKSharingStatusStarting:
                 // we're not sharing, so it can't be ours

Modified: trunk/bibdesk/BDSKSharingServer.h
===================================================================
--- trunk/bibdesk/BDSKSharingServer.h   2025-10-10 14:13:33 UTC (rev 29690)
+++ trunk/bibdesk/BDSKSharingServer.h   2025-10-10 15:04:19 UTC (rev 29691)
@@ -86,7 +86,7 @@
     NSInteger tryCount;
 }
 
-@property (class, nonatomic, readonly) BDSKSharingServer *defaultServer;
+@property (class, nonatomic, readonly) BDSKSharingServer *sharedServer;
 // base name for sharing when no pref is provided, the computer name
 @property (class, nonatomic, readonly) NSString *defaultSharingName;
 // base name for sharing

Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m   2025-10-10 14:13:33 UTC (rev 29690)
+++ trunk/bibdesk/BDSKSharingServer.m   2025-10-10 15:04:19 UTC (rev 29691)
@@ -65,7 +65,7 @@
 
 static char BDSKSharingServerDefaultsObservationContext;
 
-static id sharedInstance = nil;
+static BDSKSharingServer *sharedServer = nil;
 
 // TXT record keys
 NSString *BDSKTXTAuthenticateKey = @"authenticate";
@@ -220,17 +220,17 @@
 
 + (NSString *)currentSharingName;
 {
-    return [sharedInstance sharingName];
+    return [sharedServer sharingName];
 }
 
 // If we introduce incompatible changes in future, bump this to avoid sharing 
breakage
 + (NSString *)supportedProtocolVersion { return @"1"; }
 
-+ (BDSKSharingServer *)defaultServer;
++ (BDSKSharingServer *)sharedServer;
 {
-    if(sharedInstance == nil)
-        sharedInstance = [[self alloc] init];
-    return sharedInstance;
+    if(sharedServer == nil)
+        sharedServer = [[self alloc] init];
+    return sharedServer;
 }
 
 - (instancetype)init {

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2025-10-10 14:13:33 UTC (rev 29690)
+++ trunk/bibdesk/BibDocument.m 2025-10-10 15:04:19 UTC (rev 29691)
@@ -531,7 +531,7 @@
             [[BDSKSharingBrowser sharedBrowser] enableSharedBrowsing];
     }
     if([sud boolForKey:BDSKShouldShareFilesKey])
-        [[BDSKSharingServer defaultServer] enableSharing];
+        [[BDSKSharingServer sharedServer] enableSharing];
     
     // The UI update from setPublications is too early when loading a new 
document
     [self updateFilteringGroups];

Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2025-10-10 14:13:33 UTC (rev 29690)
+++ trunk/bibdesk/BibDocument_Actions.m 2025-10-10 15:04:19 UTC (rev 29691)
@@ -1336,7 +1336,7 @@
 #pragma mark Sharing Actions
 
 - (IBAction)refreshSharing:(id)sender{
-    [[BDSKSharingServer defaultServer] restartSharingIfNeeded];
+    [[BDSKSharingServer sharedServer] restartSharingIfNeeded];
 }
 
 - (IBAction)refreshSharedBrowsing:(id)sender{

Modified: trunk/bibdesk/BibPref_Sharing.m
===================================================================
--- trunk/bibdesk/BibPref_Sharing.m     2025-10-10 14:13:33 UTC (rev 29690)
+++ trunk/bibdesk/BibPref_Sharing.m     2025-10-10 15:04:19 UTC (rev 29691)
@@ -107,7 +107,7 @@
 
 - (void)handleSharingStatusChanged:(NSNotification *)aNotification;
 {
-    BDSKSharingServer *server = [BDSKSharingServer defaultServer];
+    BDSKSharingServer *server = [BDSKSharingServer sharedServer];
     NSString *statusMessage = nil;
     NSString *sharingName = nil;
     NSString *imageName = nil;

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