Added code to use the NSHost key in NSUserDefaults to determine the name of

the host whose pasteboard server is to be used.  If there is no NSHost value
set, the host on which the app is executing (as given by NSProcessInfo) is used.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2409 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1997-09-02 09:45:22 +00:00
parent 003456a1ac
commit 5a0f91faf9

View file

@ -39,6 +39,7 @@
#include <Foundation/NSLock.h>
#include <Foundation/NSProcessInfo.h>
#include <Foundation/NSSerialization.h>
#include <Foundation/NSUserDefaults.h>
// Pasteboard Type Globals
NSString *NSStringPboardType = @"NSStringPboardType";
@ -110,8 +111,12 @@ static id<PasteboardServer> the_server = nil;
+ (id<PasteboardServer>) _pbs
{
if (the_server == nil) {
NSString* host = [[NSProcessInfo processInfo] hostName];
NSString* host;
host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"];
if (host == nil) {
host = [[NSProcessInfo processInfo] hostName];
}
the_server = (id<PasteboardServer>)[NSConnection
rootProxyForConnectionWithRegisteredName: PBSNAME
host: host];