Construct the description string from several pieces: the OS name, its build
number and any extra information about it, instead of duplicating the code
appending the build number to the name in several places.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67753
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
switch ( info.dwMinorVersion )
{
case 0:
switch ( info.dwMinorVersion )
{
case 0:
- str.Printf(_("Windows 2000 (build %lu"),
- info.dwBuildNumber);
+ str = _("Windows 2000");
// type to resolve this ambiguity
if ( wxIsWindowsServer() == 1 )
{
// type to resolve this ambiguity
if ( wxIsWindowsServer() == 1 )
{
- str.Printf(_("Windows Server 2003 (build %lu"),
- info.dwBuildNumber);
+ str = _("Windows Server 2003");
break;
}
//else: must be XP, fall through
case 1:
break;
}
//else: must be XP, fall through
case 1:
- str.Printf(_("Windows XP (build %lu"),
- info.dwBuildNumber);
switch ( info.dwMinorVersion )
{
case 0:
switch ( info.dwMinorVersion )
{
case 0:
- if ( wxIsWindowsServer() == 1 )
- {
- str.Printf(_("Windows Server 2008 (build %lu"),
- info.dwBuildNumber);
- }
- else
- {
- str.Printf(_("Windows Vista (build %lu"),
- info.dwBuildNumber);
- }
+ str = wxIsWindowsServer() == 1
+ ? _("Windows Server 2008")
+ : _("Windows Vista");
- if ( wxIsWindowsServer() == 1 )
- {
- str.Printf(_("Windows Server 2008 R2 (build %lu"),
- info.dwBuildNumber);
- }
- else
- {
- str.Printf(_("Windows 7 (build %lu"),
- info.dwBuildNumber);
- }
+ str = wxIsWindowsServer() == 1
+ ? _("Windows Server 2008 R2")
+ : _("Windows 7");
- str.Printf(_("Windows NT %lu.%lu (build %lu"),
- info.dwMajorVersion,
- info.dwMinorVersion,
- info.dwBuildNumber);
+ str.Printf(_("Windows NT %lu.%lu"),
+ info.dwMajorVersion,
+ info.dwMinorVersion);
+ str << wxT(" (")
+ << wxString::Format(_("build %lu"), info.dwBuildNumber);
if ( !wxIsEmpty(info.szCSDVersion) )
{
str << wxT(", ") << info.szCSDVersion;
if ( !wxIsEmpty(info.szCSDVersion) )
{
str << wxT(", ") << info.szCSDVersion;