SCR: Mac: continue replacing deprecated Mac APIs

This commit is contained in:
Charlie Fenton 2017-02-25 04:56:59 -08:00
parent 044441c1ad
commit 4e9cc22f6b
1 changed files with 11 additions and 4 deletions

View File

@ -884,12 +884,19 @@ OSErr CScreensaver::GetpathToBOINCManagerApp(char* path, int maxLen)
{
CFStringRef bundleID = CFSTR("edu.berkeley.boinc");
OSType creator = 'BNC!';
FSRef theFSRef;
CFURLRef appURL = NULL;
OSStatus status = noErr;
status = LSFindApplicationForInfo(creator, bundleID, NULL, &theFSRef, NULL);
if (status == noErr)
status = FSRefMakePath(&theFSRef, (unsigned char *)path, maxLen);
status = LSFindApplicationForInfo(creator, bundleID, NULL, NULL, &appURL);
if (status == noErr) {
CFStringRef CFPath = CFURLCopyFileSystemPath(appURL, kCFURLPOSIXPathStyle);
CFStringGetCString(CFPath, path, maxLen, kCFStringEncodingUTF8);
CFRelease(CFPath);
}
if (appURL) {
CFRelease(appURL);
}
return status;
}