Browse Source

SystemStats: Make getOperatingSystemName() implementation for Windows more concise

v7.0.9
reuk 1 year ago
parent
commit
c9f0f7efa2
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
1 changed files with 11 additions and 37 deletions
  1. +11
    -37
      modules/juce_core/native/juce_SystemStats_windows.cpp

+ 11
- 37
modules/juce_core/native/juce_SystemStats_windows.cpp View File

@@ -319,45 +319,19 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
String SystemStats::getOperatingSystemName()
{
const char* name = "Unknown OS";
const auto type = getOperatingSystemType();
switch (getOperatingSystemType())
{
case Windows11: name = "Windows 11"; break;
case Windows10: name = "Windows 10"; break;
case Windows8_1: name = "Windows 8.1"; break;
case Windows8_0: name = "Windows 8.0"; break;
case Windows7: name = "Windows 7"; break;
case WinVista: name = "Windows Vista"; break;
case WinXP: name = "Windows XP"; break;
case Win2000: name = "Windows 2000"; break;
case MacOSX: JUCE_FALLTHROUGH
case Windows: JUCE_FALLTHROUGH
case Linux: JUCE_FALLTHROUGH
case Android: JUCE_FALLTHROUGH
case iOS: JUCE_FALLTHROUGH
case MacOSX_10_7: JUCE_FALLTHROUGH
case MacOSX_10_8: JUCE_FALLTHROUGH
case MacOSX_10_9: JUCE_FALLTHROUGH
case MacOSX_10_10: JUCE_FALLTHROUGH
case MacOSX_10_11: JUCE_FALLTHROUGH
case MacOSX_10_12: JUCE_FALLTHROUGH
case MacOSX_10_13: JUCE_FALLTHROUGH
case MacOSX_10_14: JUCE_FALLTHROUGH
case MacOSX_10_15: JUCE_FALLTHROUGH
case MacOS_11: JUCE_FALLTHROUGH
case MacOS_12: JUCE_FALLTHROUGH
case MacOS_13: JUCE_FALLTHROUGH
case MacOS_14: JUCE_FALLTHROUGH
case UnknownOS: JUCE_FALLTHROUGH
case WASM: JUCE_FALLTHROUGH
default: jassertfalse; break; // !! new type of OS?
}
if (type == Windows11) return "Windows 11";
if (type == Windows10) return "Windows 10";
if (type == Windows8_1) return "Windows 8.1";
if (type == Windows8_0) return "Windows 8.0";
if (type == Windows7) return "Windows 7";
if (type == WinVista) return "Windows Vista";
if (type == WinXP) return "Windows XP";
if (type == Win2000) return "Windows 2000";
return name;
jassertfalse;
return "Unknown OS";
}
String SystemStats::getDeviceDescription()


Loading…
Cancel
Save