mirror of https://github.com/snes9xgit/snes9x.git
Mac: Fix creating support folders when they don't exist
This commit is contained in:
parent
6582af1094
commit
ca52af63f4
|
@ -131,23 +131,18 @@ static NSURL *FindApplicationSupportFolder (const char *folderName)
|
||||||
{
|
{
|
||||||
purl = [s9xURL URLByAppendingPathComponent:fstr];
|
purl = [s9xURL URLByAppendingPathComponent:fstr];
|
||||||
}
|
}
|
||||||
else
|
else if ([NSFileManager.defaultManager fileExistsAtPath:oldURL.path])
|
||||||
{
|
{
|
||||||
if ([NSFileManager.defaultManager fileExistsAtPath:oldURL.path])
|
purl = [oldURL URLByAppendingPathComponent:fstr];
|
||||||
{
|
|
||||||
purl = [oldURL URLByAppendingPathComponent:fstr];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NSError *error = nil;
|
|
||||||
if ([NSFileManager.defaultManager createDirectoryAtURL:s9xURL withIntermediateDirectories:YES attributes:nil error:&error])
|
|
||||||
{
|
|
||||||
purl = [s9xURL URLByAppendingPathComponent:fstr];
|
|
||||||
AddFolderIcon(purl, folderName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (purl == NULL)
|
||||||
|
{
|
||||||
|
purl = [s9xURL URLByAppendingPathComponent:fstr];
|
||||||
|
}
|
||||||
|
|
||||||
|
[NSFileManager.defaultManager createDirectoryAtURL:purl withIntermediateDirectories:YES attributes:nil error:NULL];
|
||||||
|
|
||||||
return purl;
|
return purl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue