1
0
Fork 0
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:
ed 2018-08-15 10:22:29 +01:00
parent fd7b339e04
commit ef665c5982

View file

@ -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()