mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
Use NSFileManager methods instead of access().
This even fixes a bug where an inaccessible bspSound was being opened.
This commit is contained in:
parent
f105fbd6a0
commit
8e13a8327d
2 changed files with 4 additions and 3 deletions
|
@ -130,7 +130,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
|
|||
// Set the bspSound path
|
||||
- (id) setBspSoundPath: (NSString *)path
|
||||
{
|
||||
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
[path retain];
|
||||
[bspSound release];
|
||||
bspSound = path;
|
||||
|
@ -139,7 +139,7 @@ WriteNumericDefault (id prefs, NSString *name, float value)
|
|||
[bspSound_i release];
|
||||
bspSound_i = nil;
|
||||
}
|
||||
if (access ([path cString], R_OK)) {
|
||||
if ([fm isReadableFileAtPath: bspSound]) {
|
||||
bspSound_i = [[NSSound alloc] initWithContentsOfFile: bspSound
|
||||
byReference: YES];
|
||||
}
|
||||
|
|
|
@ -256,9 +256,10 @@ id project_i;
|
|||
{
|
||||
NSString *path;
|
||||
int rtn;
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
|
||||
path = [preferences_i getProjectPath];
|
||||
if (![path length] || access ([path cString], 0)) {
|
||||
if (![path length] || ![fm fileExistsAtPath: path]) {
|
||||
rtn = NSRunAlertPanel (@"Project Error!",
|
||||
@"A default project has not been found.\n",
|
||||
@"Open Project", NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue