From 6420bd777f7403de796dfe880f865b15738e84d1 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 21 Feb 2022 18:49:36 -0500 Subject: [PATCH] Sprinkle some wxT --- common/paths.cpp | 30 +++++++++++++++--------------- common/pgm_base.cpp | 36 ++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/common/paths.cpp b/common/paths.cpp index fc2158f668..83d83ab569 100644 --- a/common/paths.cpp +++ b/common/paths.cpp @@ -30,9 +30,9 @@ // lowercase or pretty case depending on platform #if defined( __WXMAC__ ) || defined( __WXMSW__ ) -#define KICAD_PATH_STR "KiCad" +#define KICAD_PATH_STR wxT( "KiCad" ) #else -#define KICAD_PATH_STR "kicad" +#define KICAD_PATH_STR wxT( "kicad" ) #endif @@ -55,7 +55,7 @@ wxString PATHS::GetUserPluginsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "plugins" ); + tmp.AppendDir( wxT( "plugins" ) ); return tmp.GetPath(); } @@ -66,7 +66,7 @@ wxString PATHS::GetUserPlugins3DPath() wxFileName tmp; tmp.AssignDir( PATHS::GetUserPluginsPath() ); - tmp.AppendDir( "3d" ); + tmp.AppendDir( wxT( "3d" ) ); return tmp.GetPath(); } @@ -77,7 +77,7 @@ wxString PATHS::GetUserScriptingPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "scripting" ); + tmp.AppendDir( wxT( "scripting" ) ); return tmp.GetPath(); } @@ -88,7 +88,7 @@ wxString PATHS::GetUserTemplatesPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "template" ); + tmp.AppendDir( wxT( "template" ) ); return tmp.GetPathWithSep(); } @@ -99,7 +99,7 @@ wxString PATHS::GetDefaultUserSymbolsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "symbols" ); + tmp.AppendDir( wxT( "symbols" ) ); return tmp.GetPath(); } @@ -110,7 +110,7 @@ wxString PATHS::GetDefaultUserFootprintsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "footprints" ); + tmp.AppendDir( wxT( "footprints" ) ); return tmp.GetPath(); } @@ -121,7 +121,7 @@ wxString PATHS::GetDefaultUser3DModelsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "3dmodels" ); + tmp.AppendDir( wxT( "3dmodels" ) ); return tmp.GetPath(); } @@ -131,7 +131,7 @@ wxString PATHS::GetDefault3rdPartyPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "3rdparty" ); + tmp.AppendDir( wxT( "3rdparty" ) ); return tmp.GetPath(); } @@ -141,7 +141,7 @@ wxString PATHS::GetDefaultUserProjectsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "projects" ); + tmp.AppendDir( wxT( "projects" ) ); return tmp.GetPath(); } @@ -293,7 +293,7 @@ wxString PATHS::GetStockPlugins3DPath() fn.AppendDir( wxT( "plugins" ) ); #endif - fn.AppendDir( "3d" ); + fn.AppendDir( wxT( "3d" ) ); return fn.GetPathWithSep(); } @@ -329,7 +329,7 @@ wxString PATHS::GetDocumentationPath() #if defined( __WXMAC__ ) path = GetOSXKicadDataDir(); #elif defined( __WXMSW__ ) - path = getWindowsKiCadRoot() + "share/doc/kicad"; + path = getWindowsKiCadRoot() + wxT( "share/doc/kicad" ); #else path = wxString::FromUTF8Unchecked( KICAD_DOCS ); #endif @@ -382,7 +382,7 @@ wxString PATHS::GetOSXKicadUserDataDir() // Since appname is different if started via launcher or standalone binary // map all to "kicad" here udir.RemoveLastDir(); - udir.AppendDir( "kicad" ); + udir.AppendDir( wxT( "kicad" ) ); return udir.GetPath(); } @@ -427,7 +427,7 @@ wxString PATHS::GetOSXKicadDataDir() #ifdef __WXWINDOWS__ wxString PATHS::getWindowsKiCadRoot() { - wxFileName root( Pgm().GetExecutablePath() + "/../" ); + wxFileName root( Pgm().GetExecutablePath() + wxT( "/../" ) ); root.Normalize(); return root.GetPathWithSep(); diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index c9ac0fa492..c09f531d2f 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -153,13 +153,13 @@ const wxString& PGM_BASE::GetTextEditor( bool aCanShowFileChooser ) if( !editorname ) { - if( !wxGetEnv( "EDITOR", &editorname ) ) + if( !wxGetEnv( wxT( "EDITOR" ), &editorname ) ) { // If there is no EDITOR variable set, try the desktop default #ifdef __WXMAC__ - editorname = "/usr/bin/open -e"; + editorname = wxT( "/usr/bin/open -e" ); #elif __WXX11__ - editorname = "/usr/bin/xdg-open"; + editorname = wxT( "/usr/bin/xdg-open" ); #endif } } @@ -228,7 +228,7 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit ) // Init KiCad environment // the environment variable KICAD (if exists) gives the kicad path: // something like set KICAD=d:\kicad - bool isDefined = wxGetEnv( "KICAD", &m_kicad_env ); + bool isDefined = wxGetEnv( wxT( "KICAD" ), &m_kicad_env ); if( isDefined ) // ensure m_kicad_env ends by "/" { @@ -239,7 +239,7 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit ) } // Init parameters for configuration - App().SetVendorName( "KiCad" ); + App().SetVendorName( wxT( "KiCad" ) ); App().SetAppName( pgm_name ); // Install some image handlers, mainly for help @@ -356,7 +356,7 @@ void PGM_BASE::loadCommonSettings() for( const std::pair it : GetCommonSettings()->m_Env.vars ) { - wxLogTrace( traceEnvVars, "PGM_BASE::loadSettings: Found entry %s = %s", + wxLogTrace( traceEnvVars, wxT( "PGM_BASE::loadSettings: Found entry %s = %s" ), it.first, it.second.GetValue() ); // Do not store the env var PROJECT_VAR_NAME ("KIPRJMOD") definition if for some reason @@ -413,7 +413,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) } // dictionary file name without extend (full name is kicad.mo) - wxString dictionaryName( "kicad" ); + wxString dictionaryName( wxT( "kicad" ) ); delete m_locale; m_locale = new wxLocale; @@ -422,7 +422,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) // false just because it failed to load wxstd catalog if( !m_locale->Init( m_language_id, wxLOCALE_DONT_LOAD_DEFAULT ) ) { - wxLogTrace( traceLocale, "This language is not supported by the system." ); + wxLogTrace( traceLocale, wxT( "This language is not supported by the system." ) ); setLanguageId( wxLANGUAGE_DEFAULT ); delete m_locale; @@ -435,7 +435,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) } else if( !first_time ) { - wxLogTrace( traceLocale, "Search for dictionary %s.mo in %s", + wxLogTrace( traceLocale, wxT( "Search for dictionary %s.mo in %s" ) , dictionaryName, m_locale->GetName() ); } @@ -472,7 +472,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) // the verification is skipped. if( !m_locale->IsLoaded( dictionaryName ) && m_language_id != wxLANGUAGE_ENGLISH ) { - wxLogTrace( traceLocale, "Unable to load dictionary %s.mo in %s", + wxLogTrace( traceLocale, wxT( "Unable to load dictionary %s.mo in %s" ), dictionaryName, m_locale->GetName() ); setLanguageId( wxLANGUAGE_DEFAULT ); @@ -494,7 +494,7 @@ bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg ) setLanguageId( wxLANGUAGE_DEFAULT ); // dictionary file name without extend (full name is kicad.mo) - wxString dictionaryName( "kicad" ); + wxString dictionaryName( wxT( "kicad" ) ); delete m_locale; m_locale = new wxLocale; @@ -510,7 +510,7 @@ bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg ) // the verification is skipped. if( !m_locale->IsLoaded( dictionaryName ) && m_language_id != wxLANGUAGE_ENGLISH ) { - wxLogTrace( traceLocale, "Unable to load dictionary %s.mo in %s", + wxLogTrace( traceLocale, wxT( "Unable to load dictionary %s.mo in %s" ), dictionaryName, m_locale->GetName() ); setLanguageId( wxLANGUAGE_DEFAULT ); @@ -529,7 +529,7 @@ bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg ) void PGM_BASE::SetLanguageIdentifier( int menu_id ) { - wxLogTrace( traceLocale, "Select language ID %d from %d possible languages.", + wxLogTrace( traceLocale, wxT( "Select language ID %d from %d possible languages." ), menu_id, (int)arrayDim( LanguagesList )-1 ); for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ ) @@ -551,7 +551,7 @@ void PGM_BASE::SetLanguagePath() { wxFileName fn( Pgm().GetExecutablePath() ); fn.RemoveLastDir(); - fn.AppendDir( "translation" ); + fn.AppendDir( wxT( "translation" ) ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); } } @@ -564,7 +564,7 @@ bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValu if( aName.IsEmpty() ) { wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariable: Attempt to set empty variable to value %s", + wxT( "PGM_BASE::SetLocalEnvVariable: Attempt to set empty variable to value %s" ), aValue ); return false; } @@ -573,13 +573,13 @@ bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValu if( wxGetEnv( aName, &env ) ) { wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariable: Environment variable %s already set to %s", + wxT( "PGM_BASE::SetLocalEnvVariable: Environment variable %s already set to %s" ), aName, env ); return env == aValue; } wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariable: Setting local environment variable %s to %s", + wxT( "PGM_BASE::SetLocalEnvVariable: Setting local environment variable %s to %s" ), aName, aValue ); return wxSetEnv( aName, aValue ); @@ -593,7 +593,7 @@ void PGM_BASE::SetLocalEnvVariables() for( const std::pair m_local_env_var : GetCommonSettings()->m_Env.vars ) { wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariables: Setting local environment variable %s to %s", + wxT( "PGM_BASE::SetLocalEnvVariables: Setting local environment variable %s to %s" ), m_local_env_var.first, m_local_env_var.second.GetValue() ); wxSetEnv( m_local_env_var.first, m_local_env_var.second.GetValue() );