Improved logging.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13480 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-04-16 14:16:37 +00:00
parent 98e0362f22
commit 199b2da394
2 changed files with 28 additions and 23 deletions

View file

@ -1,3 +1,7 @@
2002-04-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPasteboard.m: Improve logging on server startup.
Tue Apr 16 11:55:30 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Tools/gpbs.m (main): Fixed typo in log message - use gpbs, not

View file

@ -172,9 +172,23 @@ static NSMapTable *mimeMap = NULL;
}
else
{
static BOOL recursion = NO;
static BOOL recursion = NO;
static NSString *cmd = nil;
static NSArray *args = nil;
if (recursion)
if (cmd == nil && recursion ==NO)
{
#ifdef GNUSTEP_BASE_LIBRARY
cmd = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"gpbs"]);
#else
cmd = RETAIN([[@GNUSTEP_INSTALL_PREFIX
stringByAppendingPathComponent: @"Tools"]
stringByAppendingPathComponent: @"gpbs"]);
#endif
}
if (recursion == YES || cmd == nil)
{
NSLog(@"Unable to contact pasteboard server - "
@"please ensure that gpbs is running for %@.", description);
@ -182,29 +196,16 @@ static NSMapTable *mimeMap = NULL;
}
else
{
static NSString *cmd = nil;
static NSArray *args = nil;
NSLog(@"\nI couldn't contact the pasteboard server for %@ -\n"
@"so I'm attempting to to start one - which will take a few seconds.\n"
@"It is recommended that you start the pasteboard server (gpbs) either at\n"
@"login or (better) when your computer is started up.\n", description);
if (cmd == nil)
{
#ifdef GNUSTEP_BASE_LIBRARY
cmd = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"gpbs"]);
#else
cmd = RETAIN([[@GNUSTEP_INSTALL_PREFIX
stringByAppendingPathComponent: @"Tools"]
stringByAppendingPathComponent: @"gpbs"]);
#endif
if ([host length] > 0)
{
args = [[NSArray alloc] initWithObjects:
@"-NSHost", host, nil];
}
@"Trying to launch gpbs from %@ or a machine/operating-system subdirectory.\n"
@"It is recommended that you start the pasteboard server (gpbs) when\n"
@"your windowing system is started up.\n", description,
[cmd stringByDeletingLastPathComponent]);
if ([host length] > 0)
{
args = [[NSArray alloc] initWithObjects:
@"-NSHost", host, nil];
}
[NSTask launchedTaskWithLaunchPath: cmd arguments: args];
[NSTimer scheduledTimerWithTimeInterval: 5.0