Avoid calling deprecated wxPlatformInfo::GetArchName() in more than one place.

This commit is contained in:
jean-pierre charras 2021-11-13 09:52:08 +01:00
parent 43c85771eb
commit bfd09a4d16
3 changed files with 19 additions and 7 deletions

View File

@ -50,6 +50,18 @@ extern std::string GetCurlLibVersion();
#include <kicad_build_version.h> #include <kicad_build_version.h>
wxString GetPlatformGetBitnessName()
{
wxPlatformInfo platform;
// TODO (ISM): Read conditional once our wx fork and flatpaks are running released 3.1.5
#if 0 && wxCHECK_VERSION( 3, 1, 5 )
return platform.GetBitnessName();
#else
return platform.GetArchName();
#endif
}
wxString GetBuildVersion() wxString GetBuildVersion()
{ {
wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_VERSION_FULL ) ); wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_VERSION_FULL ) );
@ -128,12 +140,7 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
aMsg << eol; aMsg << eol;
aMsg << "Platform: " << wxGetOsDescription() << ", " aMsg << "Platform: " << wxGetOsDescription() << ", "
// TODO (ISM): Readd conditional once our wx fork and flatpaks are running released 3.1.5 << GetPlatformGetBitnessName() << ", "
#if 0 && wxCHECK_VERSION( 3, 1, 5 )
<< platform.GetBitnessName() << ", "
#else
<< platform.GetArchName() << ", "
#endif
<< platform.GetEndiannessName() << ", " << platform.GetEndiannessName() << ", "
<< platform.GetPortIdName(); << platform.GetPortIdName();

View File

@ -121,7 +121,7 @@ KICAD_CURL_EASY::KICAD_CURL_EASY() : m_headers( nullptr )
wxPlatformInfo platformInfo; wxPlatformInfo platformInfo;
wxString application( Pgm().App().GetAppName() ); wxString application( Pgm().App().GetAppName() );
wxString version( GetBuildVersion() ); wxString version( GetBuildVersion() );
wxString platform = "(" + wxGetOsDescription() + ";" + platformInfo.GetArchName(); wxString platform = "(" + wxGetOsDescription() + ";" + GetPlatformGetBitnessName();
#if defined( KICAD_BUILD_ARCH_X64 ) #if defined( KICAD_BUILD_ARCH_X64 )
platform << ";64-bit"; platform << ";64-bit";

View File

@ -38,6 +38,11 @@ class wxString;
*/ */
wxString GetBuildVersion(); wxString GetBuildVersion();
/**
* @return the bitness name string (like "Little endian")
*/
wxString GetPlatformGetBitnessName();
/** /**
* Get the semantic version string for KiCad defined inside the KiCadVersion.cmake file in * Get the semantic version string for KiCad defined inside the KiCadVersion.cmake file in
* the variable KICAD_SEMANTIC_VERSION. * the variable KICAD_SEMANTIC_VERSION.