Browse Source

Updated SystemStats::getDeviceDescription() to return the device code on iOS

tags/2021-05-28
ed 7 years ago
parent
commit
ef665c5982
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      modules/juce_core/native/juce_mac_SystemStats.mm

+ 7
- 4
modules/juce_core/native/juce_mac_SystemStats.mm 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()


Loading…
Cancel
Save