mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-20 01:14:20 +00:00
SystemStats: Use new dictionaryWithContentsOfURL signature
This commit is contained in:
parent
4fd3dfb51b
commit
35277443e4
1 changed files with 14 additions and 3 deletions
|
|
@ -121,10 +121,21 @@ static String getOSXVersion()
|
|||
{
|
||||
JUCE_AUTORELEASEPOOL
|
||||
{
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:
|
||||
nsStringLiteral ("/System/Library/CoreServices/SystemVersion.plist")];
|
||||
const String systemVersionPlist ("/System/Library/CoreServices/SystemVersion.plist");
|
||||
|
||||
return nsStringToJuce ([dict objectForKey: nsStringLiteral ("ProductVersion")]);
|
||||
#if (defined (MAC_OS_X_VERSION_10_13) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_13)
|
||||
NSError* error = nullptr;
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL: createNSURLFromFile (systemVersionPlist)
|
||||
error: &error];
|
||||
#else
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile: juceStringToNS (systemVersionPlist)];
|
||||
#endif
|
||||
|
||||
if (dict != nullptr)
|
||||
return nsStringToJuce (dict[nsStringLiteral ("ProductVersion")]);
|
||||
|
||||
jassertfalse;
|
||||
return {};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue