cope with base installed in local domain and other cases

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27151 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-11-27 14:38:45 +00:00
parent fc6e72192e
commit 61ab558bf1
4 changed files with 54 additions and 10 deletions

View file

@ -1,3 +1,10 @@
2008-11-27 Richard Frith-Macdonald <rfm@gnu.org>
* NSSound.m:
* NSWorkspace.m:
* NSPasteboard.m:
Cope with daemons being installed in any domain, not just system.
2008-11-27 01:27-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSWorkspace.m: [NSWorkspace getInfoForFile:application:type:]

View file

@ -532,6 +532,7 @@
#include <Foundation/NSConnection.h>
#include <Foundation/NSDistantObject.h>
#include <Foundation/NSDistributedNotificationCenter.h>
#include <Foundation/NSFileManager.h>
#include <Foundation/NSMapTable.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSException.h>
@ -1977,9 +1978,22 @@ static NSMapTable *mimeMap = NULL;
if (cmd == nil && recursion ==NO)
{
#ifdef GNUSTEP_BASE_LIBRARY
cmd = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"gpbs"]);
NSEnumerator *enumerator;
NSString *path;
NSFileManager *mgr;
mgr = [NSFileManager defaultManager];
enumerator = [NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSAllDomainsMask, YES) objectEnumerator];
while ((path = [enumerator nextObject]) != nil)
{
path = [path stringByAppendingPathComponent: @"gpbs"];
if ([mgr isExecutableFileAtPath: path])
{
cmd = [path copy];
break;
}
}
#else
path = RETAIN([@GNUSTEP_TOOLS_NO_DESTDIR
stringByAppendingPathComponent: @"gpbs"]);

View file

@ -174,10 +174,22 @@ static id<GSSoundSvr> the_server = nil;
if (cmd == nil && recursion == NO)
{
#ifdef GNUSTEP_BASE_LIBRARY
cmd = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES)
objectAtIndex: 0]
stringByAppendingPathComponent: @"gnustep_sndd"]);
NSEnumerator *enumerator;
NSString *path;
NSFileManager *mgr;
mgr = [NSFileManager defaultManager];
enumerator = [NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSAllDomainsMask, YES) objectEnumerator];
while ((path = [enumerator nextObject]) != nil)
{
path = [path stringByAppendingPathComponent: @"gnustep_sndd"];
if ([mgr isExecutableFileAtPath: path])
{
cmd = [path copy];
break;
}
}
#else
cmd = RETAIN([@GNUSTEP_TOOLS_NO_DESTDIR
stringByAppendingPathComponent: @"gnustep_sndd"]);

View file

@ -1274,9 +1274,20 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
if (path == nil)
{
#ifdef GNUSTEP_BASE_LIBRARY
path = RETAIN([[NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSSystemDomainMask, YES) objectAtIndex: 0]
stringByAppendingPathComponent: @"make_services"]);
NSEnumerator *enumerator;
NSString *path;
enumerator = [NSSearchPathForDirectoriesInDomains(
GSToolsDirectory, NSAllDomainsMask, YES) objectEnumerator];
while ((path = [enumerator nextObject]) != nil)
{
path = [path stringByAppendingPathComponent: @"make_services"];
if ([mgr isExecutableFileAtPath: path])
{
[path retain];
break;
}
}
#else
path = RETAIN([@GNUSTEP_TOOLS_NO_DESTDIR
stringByAppendingPathComponent: @"make_services"]);