mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Tidied defaults usage with ports
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22068 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6ba1cad122
commit
29e508442e
5 changed files with 34 additions and 40 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2005-11-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSPort.m:
|
||||||
|
* Source/NSMessagePort.m:
|
||||||
|
* Source/NSDistributedNotificationCenter.m:
|
||||||
|
* Tools/gdnc.m:
|
||||||
|
Use the NSPortIsMessagePort user default consistently to control
|
||||||
|
whether socket or message ports are used by default. Remove mingw32
|
||||||
|
sp[ecific GSMailslot user default.
|
||||||
|
|
||||||
2005-11-20 Richard Frith-Macdonald <rfm@gnu.org>
|
2005-11-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* configure.ac: Add flags to allow detection of headers/libraries
|
* configure.ac: Add flags to allow detection of headers/libraries
|
||||||
|
|
|
@ -588,18 +588,19 @@ static NSDistributedNotificationCenter *netCenter = nil;
|
||||||
Protocol *p = @protocol(GDNCProtocol);
|
Protocol *p = @protocol(GDNCProtocol);
|
||||||
NSConnection *c;
|
NSConnection *c;
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
if (_type == NSLocalNotificationCenterType
|
|
||||||
&& [[NSUserDefaults standardUserDefaults]
|
|
||||||
boolForKey: @"GSMailslot"] == NO)
|
|
||||||
{
|
|
||||||
ASSIGN(_type, GSPublicNotificationCenterType);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_type == NSLocalNotificationCenterType)
|
if (_type == NSLocalNotificationCenterType)
|
||||||
{
|
{
|
||||||
ns = [NSMessagePortNameServer sharedInstance];
|
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
|
if ([defs objectForKey: @"NSPortIsMessagePort"] != nil
|
||||||
|
&& [defs boolForKey: @"NSPortIsMessagePort"] == NO)
|
||||||
|
{
|
||||||
|
ns = [NSSocketPortNameServer sharedInstance];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ns = [NSMessagePortNameServer sharedInstance];
|
||||||
|
}
|
||||||
host = @"";
|
host = @"";
|
||||||
service = GDNC_SERVICE;
|
service = GDNC_SERVICE;
|
||||||
description = @"local host";
|
description = @"local host";
|
||||||
|
|
|
@ -83,12 +83,6 @@ Class NSPort_concrete_class;
|
||||||
{
|
{
|
||||||
NSPort_concrete_class = [NSSocketPort class];
|
NSPort_concrete_class = [NSSocketPort class];
|
||||||
}
|
}
|
||||||
#if defined(__MINGW32__)
|
|
||||||
if ([defs boolForKey: @"GSMailslot"] == NO)
|
|
||||||
{
|
|
||||||
NSPort_concrete_class = [NSSocketPort class];
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,16 +88,6 @@
|
||||||
{
|
{
|
||||||
o = [NSMessagePortNameServer sharedInstance];
|
o = [NSMessagePortNameServer sharedInstance];
|
||||||
}
|
}
|
||||||
#if defined(__MINGW__)
|
|
||||||
if ([defs boolForKey: @"GSMailslot"] == YES)
|
|
||||||
{
|
|
||||||
o = [NSMessagePortNameServer sharedInstance];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
o = [NSSocketPortNameServer sharedInstance];
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
nameServer = RETAIN(o);
|
nameServer = RETAIN(o);
|
||||||
}
|
}
|
||||||
[gnustep_global_lock unlock];
|
[gnustep_global_lock unlock];
|
||||||
|
|
27
Tools/gdnc.m
27
Tools/gdnc.m
|
@ -389,19 +389,7 @@ ihandler(int sig)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(__MINGW32__)
|
|
||||||
if ([[NSUserDefaults standardUserDefaults]
|
|
||||||
boolForKey: @"GSMailslot"] == YES)
|
|
||||||
{
|
|
||||||
isLocal = YES;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
isPublic = YES;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
isLocal = YES;
|
isLocal = YES;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -429,10 +417,21 @@ ihandler(int sig)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
|
if ([defs objectForKey: @"NSPortIsMessagePort"] != nil
|
||||||
|
&& [defs boolForKey: @"NSPortIsMessagePort"] == NO)
|
||||||
|
{
|
||||||
|
ns = [NSSocketPortNameServer sharedInstance];
|
||||||
|
port = (NSPort*)[NSSocketPort port];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ns = [NSMessagePortNameServer sharedInstance];
|
||||||
|
port = (NSPort*)[NSMessagePort port];
|
||||||
|
}
|
||||||
hostname = @"";
|
hostname = @"";
|
||||||
service = GDNC_SERVICE;
|
service = GDNC_SERVICE;
|
||||||
ns = [NSMessagePortNameServer sharedInstance];
|
|
||||||
port = (NSPort*)[NSMessagePort port];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = [[NSConnection alloc] initWithReceivePort: port sendPort: nil];
|
conn = [[NSConnection alloc] initWithReceivePort: port sendPort: nil];
|
||||||
|
|
Loading…
Reference in a new issue