mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
SystemStats: Make getOperatingSystemName() implementation for Windows more concise
This commit is contained in:
parent
28375c18c9
commit
c9f0f7efa2
1 changed files with 11 additions and 37 deletions
|
|
@ -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;
|
||||
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";
|
||||
|
||||
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?
|
||||
}
|
||||
|
||||
return name;
|
||||
jassertfalse;
|
||||
return "Unknown OS";
|
||||
}
|
||||
|
||||
String SystemStats::getDeviceDescription()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue