mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Updated SystemStats::getDeviceDescription() to return the device code on iOS
This commit is contained in:
parent
fd7b339e04
commit
ef665c5982
1 changed files with 7 additions and 4 deletions
|
|
@ -140,17 +140,20 @@ String SystemStats::getOperatingSystemName()
|
|||
String SystemStats::getDeviceDescription()
|
||||
{
|
||||
#if JUCE_IOS
|
||||
return nsStringToJuce ([[UIDevice currentDevice] model]);
|
||||
const char* name = "hw.machine";
|
||||
#else
|
||||
const char* name = "hw.model";
|
||||
#endif
|
||||
|
||||
size_t size;
|
||||
if (sysctlbyname ("hw.model", nullptr, &size, nullptr, 0) >= 0)
|
||||
if (sysctlbyname (name, nullptr, &size, nullptr, 0) >= 0)
|
||||
{
|
||||
HeapBlock<char> model (size);
|
||||
if (sysctlbyname ("hw.model", model, &size, nullptr, 0) >= 0)
|
||||
if (sysctlbyname (name, model, &size, nullptr, 0) >= 0)
|
||||
return model.get();
|
||||
}
|
||||
|
||||
return {};
|
||||
#endif
|
||||
}
|
||||
|
||||
String SystemStats::getDeviceManufacturer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue