Do not return OS info for obsolete versions.

This commit is contained in:
Catalin 2016-02-21 10:53:17 +02:00
parent 2d2bb0df39
commit edc8cd1f74

View File

@ -227,7 +227,7 @@ bool wxGetUserId(wxChar *buf,
DWORD nSize = maxSize;
if ( ::GetUserName(buf, &nSize) == 0 )
{
// actually, it does happen on Win9x if the user didn't log on
// actually, it does happen if the user didn't log on
DWORD res = ::GetEnvironmentVariable(wxT("username"), buf, maxSize);
if ( res == 0 )
{
@ -1073,57 +1073,6 @@ wxString wxGetOsDescription()
const OSVERSIONINFOEXW info = wxGetWindowsVersionInfo();
switch ( info.dwPlatformId )
{
#ifdef VER_PLATFORM_WIN32_CE
case VER_PLATFORM_WIN32_CE:
str.Printf(_("Windows CE (%d.%d)"),
info.dwMajorVersion,
info.dwMinorVersion);
break;
#endif
case VER_PLATFORM_WIN32s:
str = _("Win32s on Windows 3.1");
break;
case VER_PLATFORM_WIN32_WINDOWS:
switch (info.dwMinorVersion)
{
case 0:
if ( info.szCSDVersion[1] == 'B' ||
info.szCSDVersion[1] == 'C' )
{
str = _("Windows 95 OSR2");
}
else
{
str = _("Windows 95");
}
break;
case 10:
if ( info.szCSDVersion[1] == 'B' ||
info.szCSDVersion[1] == 'C' )
{
str = _("Windows 98 SE");
}
else
{
str = _("Windows 98");
}
break;
case 90:
str = _("Windows ME");
break;
default:
str.Printf(_("Windows 9x (%d.%d)"),
info.dwMajorVersion,
info.dwMinorVersion);
break;
}
if ( !wxIsEmpty(info.szCSDVersion) )
{
str << wxT(" (") << info.szCSDVersion << wxT(')');
}
break;
case VER_PLATFORM_WIN32_NT:
switch ( info.dwMajorVersion )
{
@ -1301,38 +1250,12 @@ wxWinVersion wxGetWinVersion()
verMin;
switch ( wxGetOsVersion(&verMaj, &verMin) )
{
case wxOS_WINDOWS_9X:
if ( verMaj == 4 )
{
switch ( verMin )
{
case 0:
return wxWinVersion_95;
case 10:
return wxWinVersion_98;
case 90:
return wxWinVersion_ME;
}
}
break;
case wxOS_WINDOWS_NT:
switch ( verMaj )
{
case 3:
return wxWinVersion_NT3;
case 4:
return wxWinVersion_NT4;
case 5:
switch ( verMin )
{
case 0:
return wxWinVersion_2000;
case 1:
return wxWinVersion_XP;