mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 05:30:37 +00:00
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:
parent
c9536c6a2d
commit
a92177e9f8
1 changed files with 6 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue