Revision: 27864
          http://sourceforge.net/p/bibdesk/svn/27864
Author:   hofman
Date:     2022-09-07 09:09:47 +0000 (Wed, 07 Sep 2022)
Log Message:
-----------
accessor for current name for sharing that does not create the default server

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

Modified: trunk/bibdesk/BDSKSharingBrowser.m
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.m  2022-09-07 06:30:18 UTC (rev 27863)
+++ trunk/bibdesk/BDSKSharingBrowser.m  2022-09-07 09:09:47 UTC (rev 27864)
@@ -122,7 +122,7 @@
         // the service was removed in the meantime
         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 defaultServer] 
sharingName]] && [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKEnableSharingWithSelfKey] == NO) {
+    if ([[aNetService name] isEqualToString:[BDSKSharingServer 
currentSharingName]] && [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKEnableSharingWithSelfKey] == NO) {
         switch ([[BDSKSharingServer defaultServer] status]) {
             case BDSKSharingStatusOff:
             case BDSKSharingStatusStarting:

Modified: trunk/bibdesk/BDSKSharingServer.h
===================================================================
--- trunk/bibdesk/BDSKSharingServer.h   2022-09-07 06:30:18 UTC (rev 27863)
+++ trunk/bibdesk/BDSKSharingServer.h   2022-09-07 09:09:47 UTC (rev 27864)
@@ -89,6 +89,8 @@
 + (NSString *)defaultSharingName;
 // base name for sharing
 + (NSString *)sharingName;
+// name currently used for sharing
++ (NSString *)currentSharingName;
 + (NSString *)supportedProtocolVersion;
 
 // actual name used for sharing, unique name based on +sharingName

Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m   2022-09-07 06:30:18 UTC (rev 27863)
+++ trunk/bibdesk/BDSKSharingServer.m   2022-09-07 09:09:47 UTC (rev 27864)
@@ -213,6 +213,11 @@
     return sharingName;
 }
 
++ (NSString *)currentSharingName;
+{
+    return [sharedInstance sharingName];
+}
+
 // If we introduce incompatible changes in future, bump this to avoid sharing 
breakage
 + (NSString *)supportedProtocolVersion { return @"1"; }
 

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