Some more wxS

This commit is contained in:
Marek Roszko 2023-01-16 19:07:41 -05:00
parent 167e430fd9
commit ac94995f70
26 changed files with 135 additions and 135 deletions

View File

@ -248,7 +248,7 @@ void S3D_PLUGIN_MANAGER::listPlugins( const wxString& aPath, std::list< wxString
// Per definition a loadable "xxx.bundle" is similar to an "xxx.app" app
// bundle being a folder with some special content in it. We obviously don't
// want to have that here for our loadable module, so just use ".so".
nameFilter.Append( ".so" );
nameFilter.Append( wxS( ".so" ) );
#endif
wxString lp = wd.GetNameWithSep();

View File

@ -151,16 +151,16 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
m_auimgr.SetManagedWindow( this );
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer( 1 ) );
m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) ).Top().Layer( 6 ) );
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( wxS( "InfoBar" ) ).Top().Layer( 1 ) );
m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) ).Center() );
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
// hiding it.
m_auimgr.Update();
// We don't want the infobar displayed right away
m_auimgr.GetPane( "InfoBar" ).Hide();
m_auimgr.GetPane( wxS( "InfoBar" ) ).Hide();
m_auimgr.Update();
m_canvas->SetInfoBar( m_infoBar );

View File

@ -490,9 +490,9 @@ wxString BM2CMP_FRAME::FormatOutputSize( double aSize )
wxString text;
if( getUnitFromSelection() == EDA_UNITS::MILLIMETRES )
text.Printf( "%.1f", aSize );
text.Printf( wxS( "%.1f" ), aSize );
else if( getUnitFromSelection() == EDA_UNITS::INCHES )
text.Printf( "%.2f", aSize );
text.Printf( wxS( "%.2f" ), aSize );
else
text.Printf( wxT( "%d" ), KiROUND( aSize ) );

View File

@ -87,7 +87,7 @@ bool ASSET_ARCHIVE::Load()
long ASSET_ARCHIVE::GetFileContents( const wxString& aFilePath, const unsigned char* aDest,
size_t aMaxLen )
{
wxFAIL_MSG( "Unimplemented" );
wxFAIL_MSG( wxS( "Unimplemented" ) );
return 0;
}

View File

@ -73,7 +73,7 @@ const wxString& BASE_SCREEN::GetPageNumber() const
static wxString pageNumber;
if( m_pageNumber.IsEmpty() )
pageNumber.Printf( "%d", m_virtualPageNumber );
pageNumber.Printf( wxS( "%d" ), m_virtualPageNumber );
else
pageNumber = m_pageNumber;
@ -86,9 +86,9 @@ const wxString& BASE_SCREEN::GetPageNumber() const
void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const
{
// for now, make it look like XML, expand on this later.
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << wxS( ">\n" );
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << wxS( ">\n" );
}
#endif

View File

@ -392,7 +392,7 @@ static struct EDA_ITEM_DESC
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( EDA_ITEM );
auto typeProp = new PROPERTY_ENUM<EDA_ITEM, KICAD_T>( "Type",
auto typeProp = new PROPERTY_ENUM<EDA_ITEM, KICAD_T>( wxS( "Type" ),
NO_SETTER( EDA_ITEM, KICAD_T ), &EDA_ITEM::Type );
typeProp->SetIsInternal( true );
propMgr.AddProperty( typeProp );

View File

@ -239,15 +239,15 @@ bool EDA_PATTERN_MATCH_RELATIONAL::SetPattern( const wxString& aPattern )
m_key = key.Lower();
if( rel == "<" )
if( rel == wxS( "<" ) )
m_relation = LT;
else if( rel == "<=" )
else if( rel == wxS( "<=" ) )
m_relation = LE;
else if( rel == "=" )
else if( rel == wxS( "=" ) )
m_relation = EQ;
else if( rel == ">=" )
else if( rel == wxS( ">=" ) )
m_relation = GE;
else if( rel == ">" )
else if( rel == wxS( ">" ) )
m_relation = GT;
else
return false;
@ -351,19 +351,19 @@ wxRegEx EDA_PATTERN_MATCH_RELATIONAL::m_regex_description(
wxRegEx EDA_PATTERN_MATCH_RELATIONAL::m_regex_search(
R"(^(\w+)(<|<=|=|>=|>)([-+]?[\d.]*)(\w*)$)", wxRE_ADVANCED );
const std::map<wxString, double> EDA_PATTERN_MATCH_RELATIONAL::m_units = {
{ "p", 1e-12 },
{ "n", 1e-9 },
{ "u", 1e-6 },
{ "m", 1e-3 },
{ "", 1. },
{ "k", 1e3 },
{ "meg",1e6 },
{ "g", 1e9 },
{ "t", 1e12 },
{ "ki", 1024. },
{ "mi", 1048576. },
{ "gi", 1073741824. },
{ "ti", 1099511627776. } };
{ wxS( "p" ), 1e-12 },
{ wxS( "n" ), 1e-9 },
{ wxS( "u" ), 1e-6 },
{ wxS( "m" ), 1e-3 },
{ wxS( "" ), 1. },
{ wxS( "k" ), 1e3 },
{ wxS( "meg" ), 1e6 },
{ wxS( "g" ), 1e9 },
{ wxS( "t" ), 1e12 },
{ wxS( "ki" ), 1024. },
{ wxS( "mi" ), 1048576. },
{ wxS( "gi" ), 1073741824. },
{ wxS( "ti" ), 1099511627776. } };
EDA_COMBINED_MATCHER::EDA_COMBINED_MATCHER( const wxString& aPattern,

View File

@ -76,13 +76,13 @@ wxString EDA_SHAPE::SHAPE_T_asString() const
{
switch( m_shape )
{
case SHAPE_T::SEGMENT: return "S_SEGMENT";
case SHAPE_T::RECT: return "S_RECT";
case SHAPE_T::ARC: return "S_ARC";
case SHAPE_T::CIRCLE: return "S_CIRCLE";
case SHAPE_T::POLY: return "S_POLYGON";
case SHAPE_T::BEZIER: return "S_CURVE";
case SHAPE_T::LAST: return "!S_LAST!"; // Synthetic value, but if we come across it then
case SHAPE_T::SEGMENT: return wxS( "S_SEGMENT" );
case SHAPE_T::RECT: return wxS( "S_RECT" );
case SHAPE_T::ARC: return wxS( "S_ARC" );
case SHAPE_T::CIRCLE: return wxS( "S_CIRCLE" );
case SHAPE_T::POLY: return wxS( "S_POLYGON" );
case SHAPE_T::BEZIER: return wxS( "S_CURVE" );
case SHAPE_T::LAST: return wxS( "!S_LAST!" ); // Synthetic value, but if we come across it then
// we're going to want to know.
}
@ -649,7 +649,7 @@ void EDA_SHAPE::ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PA
break;
case SHAPE_T::POLY:
msg.Printf( "%d", GetPolyShape().Outline(0).PointCount() );
msg.Printf( wxS( "%d" ), GetPolyShape().Outline(0).PointCount() );
aList.emplace_back( _( "Points" ), msg );
break;

View File

@ -97,8 +97,8 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged )
if( m_paths.empty() )
{
SEARCH_PATH al;
al.m_Alias = "${KIPRJMOD}";
al.m_Pathvar = "${KIPRJMOD}";
al.m_Alias = wxS( "${KIPRJMOD}" );
al.m_Pathvar = wxS( "${KIPRJMOD}" );
al.m_Pathexp = m_curProjDir;
m_paths.push_back( al );
@ -163,8 +163,8 @@ bool FILENAME_RESOLVER::createPathList()
// the user may change this later with a call to SetProjectDir()
SEARCH_PATH lpath;
lpath.m_Alias = "${KIPRJMOD}";
lpath.m_Pathvar = "${KIPRJMOD}";
lpath.m_Alias = wxS( "${KIPRJMOD}" );
lpath.m_Pathvar = wxS( "${KIPRJMOD}" );
lpath.m_Pathexp = m_curProjDir;
m_paths.push_back( lpath );
wxFileName fndummy;
@ -211,12 +211,12 @@ bool FILENAME_RESOLVER::createPathList()
return false;
#ifdef DEBUG
wxLogTrace( MASK_3D_RESOLVER, " * [3D model] search paths:\n" );
wxLogTrace( MASK_3D_RESOLVER, wxS( " * [3D model] search paths:\n" ) );
std::list< SEARCH_PATH >::const_iterator sPL = m_paths.begin();
while( sPL != m_paths.end() )
{
wxLogTrace( MASK_3D_RESOLVER, " + %s : '%s'\n", (*sPL).m_Alias.GetData(),
wxLogTrace( MASK_3D_RESOLVER, wxS( " + %s : '%s'\n" ), (*sPL).m_Alias.GetData(),
(*sPL).m_Pathexp.GetData() );
++sPL;
}
@ -275,7 +275,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
// special case: if a path begins with ${ENV_VAR} but is not in the resolver's path list
// then add it.
if( aFileName.StartsWith( "${" ) || aFileName.StartsWith( "$(" ) )
if( aFileName.StartsWith( wxS( "${" ) ) || aFileName.StartsWith( wxS( "$(" ) ) )
checkEnvVarPath( aFileName );
return tname;
@ -340,10 +340,10 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
}
// check the partial path relative to ${KICAD6_3DMODEL_DIR} (legacy behavior)
if( !tname.StartsWith( ":" ) )
if( !tname.StartsWith( wxS( ":" ) ) )
{
wxFileName fpath;
wxString fullPath( "${KICAD6_3DMODEL_DIR}" );
wxString fullPath( wxS( "${KICAD6_3DMODEL_DIR}" ) );
fullPath.Append( fpath.GetPathSeparator() );
fullPath.Append( tname );
fullPath = ExpandEnvVarSubstitutions( fullPath, m_project );
@ -369,9 +369,9 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
// but ${KICAD6_3DMODEL_DIR} is not set or is incorrect.
m_errflags |= ERRFLG_RELPATH;
wxString errmsg = "[3D File Resolver] No such path";
errmsg.append( "\n" );
errmsg.append( wxS( "\n" ) );
errmsg.append( tname );
errmsg.append( "\n" );
errmsg.append( wxS( "\n" ) );
wxLogTrace( tracePathsAndFiles, errmsg );
}
@ -381,7 +381,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
for( const SEARCH_PATH& path : m_paths )
{
// ${ENV_VAR} paths have already been checked; skip them
if( path.m_Alias.StartsWith( "${" ) || path.m_Alias.StartsWith( "$(" ) )
if( path.m_Alias.StartsWith( wxS( "${" ) ) || path.m_Alias.StartsWith( wxS( "$(" ) ) )
continue;
if( path.m_Alias == alias && !path.m_Pathexp.empty() )
@ -442,9 +442,9 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath )
if( !path.DirExists() )
{
if( aPath.m_Pathvar == "${KICAD6_3DMODEL_DIR}"
|| aPath.m_Pathvar == "${KIPRJMOD}" || aPath.m_Pathvar == "$(KIPRJMOD)"
|| aPath.m_Pathvar == "${KISYS3DMOD}" || aPath.m_Pathvar == "$(KISYS3DMOD)" )
if( aPath.m_Pathvar == wxS( "${KICAD6_3DMODEL_DIR}" )
|| aPath.m_Pathvar == wxS( "${KIPRJMOD}" ) || aPath.m_Pathvar == wxS( "$(KIPRJMOD)" )
|| aPath.m_Pathvar == wxS( "${KISYS3DMOD}" ) || aPath.m_Pathvar == wxS( "$(KISYS3DMOD)" ) )
{
// suppress the message if the missing pathvar is a system variable
}
@ -503,17 +503,17 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath )
{
bool useParen = false;
if( aPath.StartsWith( "$(" ) )
if( aPath.StartsWith( wxS( "$(" ) ) )
useParen = true;
else if( !aPath.StartsWith( "${" ) )
else if( !aPath.StartsWith( wxS( "${" ) ) )
return;
size_t pEnd;
if( useParen )
pEnd = aPath.find( ")" );
pEnd = aPath.find( wxS( ")" ) );
else
pEnd = aPath.find( "}" );
pEnd = aPath.find( wxS( "}" ) );
if( pEnd == wxString::npos )
return;
@ -530,7 +530,7 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath )
if( sPL->m_Alias == envar )
return;
if( !sPL->m_Alias.StartsWith( "${" ) )
if( !sPL->m_Alias.StartsWith( wxS( "${" ) ) )
break;
++sPL;
@ -584,7 +584,7 @@ wxString FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName )
wxFileName fpath;
// in the case of aliases, ensure that we use the most recent definition
if( sL->m_Alias.StartsWith( "${" ) || sL->m_Alias.StartsWith( "$(" ) )
if( sL->m_Alias.StartsWith( wxS( "${" ) ) || sL->m_Alias.StartsWith( wxS( "$(" ) ) )
{
wxString tpath = ExpandEnvVarSubstitutions( sL->m_Alias, m_project );
@ -615,11 +615,11 @@ wxString FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName )
fname.Replace( wxT( "\\" ), wxT( "/" ) );
#endif
if( sL->m_Alias.StartsWith( "${" ) || sL->m_Alias.StartsWith( "$(" ) )
if( sL->m_Alias.StartsWith( wxS( "${" ) ) || sL->m_Alias.StartsWith( wxS( "$(" ) ) )
{
// old style ENV_VAR
tname = sL->m_Alias;
tname.Append( "/" );
tname.Append( wxS( "/" ) );
tname.append( fname );
}
else
@ -627,7 +627,7 @@ wxString FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName )
// new style alias
tname = ":";
tname.append( sL->m_Alias );
tname.append( ":" );
tname.append( wxS( ":" ) );
tname.append( fname );
}
@ -746,9 +746,9 @@ bool FILENAME_RESOLVER::ValidateFileName( const wxString& aFileName, bool& hasAl
// environment string before testing
aliasEnd = wxString::npos;
if( aFileName.StartsWith( "${" ) )
if( aFileName.StartsWith( wxS( "${" ) ) )
aliasEnd = aFileName.find( '}' );
else if( aFileName.StartsWith( "$(" ) )
else if( aFileName.StartsWith( wxS( "$(" ) ) )
aliasEnd = aFileName.find( ')' );
if( aliasEnd != wxString::npos )

View File

@ -95,7 +95,7 @@ bool FONTCONFIG::FindFont( const wxString& aFontName, wxString& aFontFile )
if( !styleStr.IsEmpty() )
{
styleStr.Replace( " ", ":" );
styleStr.Replace( wxS( " " ), wxS( ":" ) );
fontName += ":" + styleStr;
}
}

View File

@ -93,10 +93,10 @@ OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, boo
wxString qualifiedFontName = aFontName;
if( aBold )
qualifiedFontName << ":Bold";
qualifiedFontName << wxS( ":Bold" );
if( aItalic )
qualifiedFontName << ":Italic";
qualifiedFontName << wxS( ":Italic" );
if( Fontconfig()->FindFont( qualifiedFontName, fontFile ) )
(void) font->loadFace( fontFile );

View File

@ -137,9 +137,9 @@ bool FOOTPRINT_FILTER_IT::FootprintFilterMatch( FOOTPRINT_INFO& aItem )
name.Empty();
// If the filter contains a ':' character, include the library name in the pattern
if( each_filter->GetPattern().Contains( ":" ) )
if( each_filter->GetPattern().Contains( wxS( ":" ) ) )
{
name = aItem.GetLibNickname().Lower() + ":";
name = aItem.GetLibNickname().Lower() + wxS( ":" );
}
name += aItem.GetFootprintName().Lower();

View File

@ -107,7 +107,7 @@ void FOOTPRINT_LIST::DisplayErrors( wxTopLevelWindow* aWindow )
wxString tmp = error->Problem();
// Preserve new lines in error messages so queued errors don't run together.
tmp.Replace( "\n", "<BR>" );
tmp.Replace( wxS( "\n" ), wxS( "<BR>" ) );
msg += wxT( "<p>" ) + tmp + wxT( "</p>" );
}
@ -148,7 +148,7 @@ FOOTPRINT_LIST* FOOTPRINT_LIST::GetInstance( KIWAY& aKiway )
return nullptr;
if( !footprintInfo->GetCount() )
footprintInfo->ReadCacheFromFile( aKiway.Prj().GetProjectPath() + "fp-info-cache" );
footprintInfo->ReadCacheFromFile( aKiway.Prj().GetProjectPath() + wxS( "fp-info-cache" ) );
return footprintInfo;
}

View File

@ -476,7 +476,7 @@ FOOTPRINT* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootp
const wxString FP_LIB_TABLE::GlobalPathEnvVariableName()
{
return "KICAD6_FOOTPRINT_DIR";
return wxS( "KICAD6_FOOTPRINT_DIR" );
}
@ -501,25 +501,25 @@ public:
// consider a directory to be a lib if it's name ends with .pretty and
// it is under $KICAD6_3RD_PARTY/footprints/<pkgid>/ i.e. has nested level of at least +3
if( dirPath.EndsWith( ".pretty" ) && dir.GetDirCount() >= m_prefix_dir_count + 3 )
if( dirPath.EndsWith( wxS( ".pretty" ) ) && dir.GetDirCount() >= m_prefix_dir_count + 3 )
{
wxArrayString parts = dir.GetDirs();
parts.RemoveAt( 0, m_prefix_dir_count );
parts.Insert( "${KICAD6_3RD_PARTY}", 0 );
parts.Insert( wxS( "${KICAD6_3RD_PARTY}" ), 0 );
wxString libPath = wxJoin( parts, '/' );
if( !m_lib_table.HasLibraryWithPath( libPath ) )
{
wxString name = parts.Last().substr( 0, parts.Last().length() - 7 );
wxString nickname = wxString::Format( "%s%s", m_lib_prefix, name );
wxString nickname = wxString::Format( wxS( "%s%s" ), m_lib_prefix, name );
if( m_lib_table.HasLibrary( nickname ) )
{
int increment = 1;
do
{
nickname = wxString::Format( "%s%s_%d", m_lib_prefix, name, increment );
nickname = wxString::Format( wxS( "%s%s_%d" ), m_lib_prefix, name, increment );
increment++;
} while( m_lib_table.HasLibrary( nickname ) );
}
@ -591,7 +591,7 @@ bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable )
// Scan for libraries in PCM packages directory
wxFileName d( packagesPath, "" );
d.AppendDir( "footprints" );
d.AppendDir( wxS( "footprints" ) );
if( d.DirExists() )
{

View File

@ -359,12 +359,12 @@ wxCursor constructCursor( const CURSOR_STORE::CURSOR_DEF& aDef )
};
#else
wxASSERT_MSG( false, "Unknown platform for cursor construction." );
wxASSERT_MSG( false, wxS( "Unknown platform for cursor construction." ) );
return wxNullCursor;
#endif
}
wxASSERT_MSG( false, "Unknown to find cursor" );
wxASSERT_MSG( false, wxS( "Unknown to find cursor" ) );
return wxNullCursor;
}

View File

@ -59,7 +59,7 @@ static std::optional<double> getKiCadConfiguredScale( const COMMON_SETTINGS& aCo
if( scale )
{
wxLogTrace( traceHiDpi, "Scale factor (configured): %f", *scale );
wxLogTrace( traceHiDpi, wxS( "Scale factor (configured): %f" ), *scale );
}
return scale;
@ -80,12 +80,12 @@ static std::optional<double> getEnvironmentScale()
if( port_id == wxPORT_GTK )
{
// Under GTK, the user can use GDK_SCALE to force the scaling
scale = ENV_VAR::GetEnvVar<double>( "GDK_SCALE" );
scale = ENV_VAR::GetEnvVar<double>( wxS( "GDK_SCALE" ) );
}
if( scale )
{
wxLogTrace( traceHiDpi, "Scale factor (environment): %f", *scale );
wxLogTrace( traceHiDpi, wxS( "Scale factor (environment): %f" ), *scale );
}
return scale;
@ -118,14 +118,14 @@ double DPI_SCALING::GetScaleFactor() const
// On Linux, this will not work until WX 3.2 and GTK >= 3.10
// Otherwise it returns 1.0
val = KIPLATFORM::UI::GetSystemScaleFactor( m_window );
wxLogTrace( traceHiDpi, "Scale factor (WX): %f", *val );
wxLogTrace( traceHiDpi, wxS( "Scale factor (WX): %f" ), *val );
}
if( !val )
{
// Nothing else we can do, give it a default value
val = GetDefaultScaleFactor();
wxLogTrace( traceHiDpi, "Scale factor (default): %f", *val );
wxLogTrace( traceHiDpi, wxS( "Scale factor (default): %f" ), *val );
}
return *val;
@ -141,14 +141,14 @@ bool DPI_SCALING::GetCanvasIsAutoScaled() const
}
const bool automatic = getKiCadConfiguredScale( *m_config ) == std::nullopt;
wxLogTrace( traceHiDpi, "Scale is automatic: %d", automatic );
wxLogTrace( traceHiDpi, wxS( "Scale is automatic: %d" ), automatic );
return automatic;
}
void DPI_SCALING::SetDpiConfig( bool aAuto, double aValue )
{
wxCHECK_RET( m_config != nullptr, "Setting DPI config without a config store." );
wxCHECK_RET( m_config != nullptr, wxS( "Setting DPI config without a config store." ) );
const double value = aAuto ? 0.0 : aValue;

View File

@ -74,7 +74,7 @@ GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS()
void GAL_DISPLAY_OPTIONS::ReadWindowSettings( WINDOW_SETTINGS& aCfg )
{
wxLogTrace( traceGalDispOpts, "Reading app-specific options" );
wxLogTrace( traceGalDispOpts, wxS( "Reading app-specific options" ) );
m_gridStyle = UTIL::GetValFromConfig( gridStyleConfigVals, aCfg.grid.style );
m_gridSnapping = UTIL::GetValFromConfig( gridSnapConfigVals, aCfg.grid.snap );
@ -91,7 +91,7 @@ void GAL_DISPLAY_OPTIONS::ReadWindowSettings( WINDOW_SETTINGS& aCfg )
void GAL_DISPLAY_OPTIONS::ReadCommonConfig( COMMON_SETTINGS& aSettings, wxWindow* aWindow )
{
wxLogTrace( traceGalDispOpts, "Reading common config" );
wxLogTrace( traceGalDispOpts, wxS( "Reading common config" ) );
gl_antialiasing_mode = static_cast<KIGFX::OPENGL_ANTIALIASING_MODE>(
aSettings.m_Graphics.opengl_aa_mode );
@ -109,7 +109,7 @@ void GAL_DISPLAY_OPTIONS::ReadCommonConfig( COMMON_SETTINGS& aSettings, wxWindow
void GAL_DISPLAY_OPTIONS::ReadConfig( COMMON_SETTINGS& aCommonConfig,
WINDOW_SETTINGS& aWindowConfig, wxWindow* aWindow )
{
wxLogTrace( traceGalDispOpts, "Reading common and app config" );
wxLogTrace( traceGalDispOpts, wxS( "Reading common and app config" ) );
ReadWindowSettings( aWindowConfig );
@ -119,7 +119,7 @@ void GAL_DISPLAY_OPTIONS::ReadConfig( COMMON_SETTINGS& aCommonConfig,
void GAL_DISPLAY_OPTIONS::WriteConfig( WINDOW_SETTINGS& aCfg )
{
wxLogTrace( traceGalDispOpts, "Writing window settings" );
wxLogTrace( traceGalDispOpts, wxS( "Writing window settings" ) );
aCfg.grid.style = UTIL::GetConfigForVal( gridStyleConfigVals, m_gridStyle );
aCfg.grid.snap = UTIL::GetConfigForVal( gridSnapConfigVals, m_gridSnapping );
@ -143,7 +143,7 @@ void GAL_DISPLAY_OPTIONS::UpdateScaleFactor()
void GAL_DISPLAY_OPTIONS::NotifyChanged()
{
wxLogTrace( traceGalDispOpts, "Change notification" );
wxLogTrace( traceGalDispOpts, wxS( "Change notification" ) );
Notify( &GAL_DISPLAY_OPTIONS_OBSERVER::OnGalDisplayOptionsChanged, *this );
}

View File

@ -59,19 +59,19 @@ wxString GbrMakeCreationDateAttributeString( GBR_NC_STRING_FORMAT aFormat )
switch( aFormat )
{
case GBR_NC_STRING_FORMAT_X2:
msg.Printf( "%%TF.CreationDate,%s%s*%%", date.FormatISOCombined(), timezone_offset );
msg.Printf( wxS( "%%TF.CreationDate,%s%s*%%" ), date.FormatISOCombined(), timezone_offset );
break;
case GBR_NC_STRING_FORMAT_X1:
msg.Printf( "G04 #@! TF.CreationDate,%s%s*", date.FormatISOCombined(), timezone_offset );
msg.Printf( wxS( "G04 #@! TF.CreationDate,%s%s*" ), date.FormatISOCombined(), timezone_offset );
break;
case GBR_NC_STRING_FORMAT_GBRJOB:
msg.Printf( "%s%s", date.FormatISOCombined(), timezone_offset );
msg.Printf( wxS( "%s%s" ), date.FormatISOCombined(), timezone_offset );
break;
case GBR_NC_STRING_FORMAT_NCDRILL:
msg.Printf( "; #@! TF.CreationDate,%s%s", date.FormatISOCombined(), timezone_offset );
msg.Printf( wxS( "; #@! TF.CreationDate,%s%s" ), date.FormatISOCombined(), timezone_offset );
break;
}
return msg;

View File

@ -354,7 +354,7 @@ void ReadHotKeyConfig( const wxString& aFileName, std::map<std::string, int>& aH
if( fileName.IsEmpty() )
{
wxFileName fn( "user" );
wxFileName fn( wxS( "user" ) );
fn.SetExt( HotkeyFileExtension );
fn.SetPath( SETTINGS_MANAGER::GetUserSettingsPath() );
fileName = fn.GetFullPath();
@ -371,11 +371,11 @@ void ReadHotKeyConfig( const wxString& aFileName, std::map<std::string, int>& aH
wxString input;
file.ReadAll( &input );
input.Replace( "\r\n", "\n" ); // Convert Windows files to Unix line-ends
wxStringTokenizer fileTokenizer( input, "\n", wxTOKEN_STRTOK );
wxStringTokenizer fileTokenizer( input, wxS( "\n" ), wxTOKEN_STRTOK );
while( fileTokenizer.HasMoreTokens() )
{
wxStringTokenizer lineTokenizer( fileTokenizer.GetNextToken(), "\t" );
wxStringTokenizer lineTokenizer( fileTokenizer.GetNextToken(), wxS( "\t" ) );
wxString cmdName = lineTokenizer.GetNextToken();
wxString keyName = lineTokenizer.GetNextToken();

View File

@ -136,23 +136,23 @@ KICAD_CURL_EASY::KICAD_CURL_EASY() :
wxPlatformInfo platformInfo;
wxString application( Pgm().App().GetAppName() );
wxString version( GetBuildVersion() );
wxString platform = "(" + wxGetOsDescription() + ";" + GetPlatformGetBitnessName();
wxString platform = wxS( "(" ) + wxGetOsDescription() + wxS( ";" ) + GetPlatformGetBitnessName();
#if defined( KICAD_BUILD_ARCH_X64 )
platform << ";64-bit";
platform << wxS( ";64-bit" );
#elif defined( KICAD_BUILD_ARCH_X86 )
platform << ";32-bit";
platform << wxS( ";32-bit" );
#elif defined( KICAD_BUILD_ARCH_ARM )
platform << ";ARM 32-bit";
platform << wxS( ";ARM 32-bit" );
#elif defined( KICAD_BUILD_ARCH_ARM64 )
platform << ";ARM 64-bit";
platform << wxS( ";ARM 64-bit" );
#endif
platform << ")";
platform << wxS( ")" );
wxString user_agent = "KiCad/" + version + " " + platform + " " + application;
wxString user_agent = wxS( "KiCad/" ) + version + wxS( " " ) + platform + wxS( " " ) + application;
user_agent << "/" << GetBuildDate();
user_agent << wxS( "/" ) << GetBuildDate();
setOption<const char*>( CURLOPT_USERAGENT, user_agent.ToStdString().c_str() );
setOption( CURLOPT_ACCEPT_ENCODING, "gzip,deflate" );
}

View File

@ -782,9 +782,9 @@ void KICAD_MANAGER_FRAME::ProjectChanged()
}
if( ADVANCED_CFG::GetCfg().m_HideVersionFromTitle )
title += wxT( " \u2014 " ) + wxString( "KiCad" );
title += wxT( " \u2014 " ) + wxString( wxS( "KiCad" ) );
else
title += wxT( " \u2014 " ) + wxString( "KiCad " ) + GetMajorMinorVersion();
title += wxT( " \u2014 " ) + wxString( wxS( "KiCad " ) ) + GetMajorMinorVersion();
SetTitle( title );
}

View File

@ -127,7 +127,7 @@ void KICAD_MANAGER_FRAME::doReCreateMenuBar()
BITMAPS::unzip );
fileMenu->AppendSeparator();
fileMenu->AddQuitOrClose( nullptr, "KiCad" );
fileMenu->AddQuitOrClose( nullptr, wxS( "KiCad" ) );
//-- Edit menu -----------------------------------------------------------
//
@ -199,7 +199,7 @@ void KICAD_MANAGER_FRAME::doReCreateMenuBar()
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
prefsMenu->Add( _( "Preferences..." ) + wxS( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );

View File

@ -41,11 +41,11 @@
std::unordered_map<PCM_PACKAGE_VERSION_STATUS, wxString> PANEL_PACKAGES_VIEW::STATUS_ENUM_TO_STR = {
{ PVS_INVALID, "invalid" },
{ PVS_STABLE, "stable" },
{ PVS_TESTING, "testing" },
{ PVS_DEVELOPMENT, "development" },
{ PVS_DEPRECATED, "deprecated" }
{ PVS_INVALID, wxS( "invalid" ) },
{ PVS_STABLE, wxS( "stable" ) },
{ PVS_TESTING, wxS( "testing" ) },
{ PVS_DEVELOPMENT, wxS( "development" ) },
{ PVS_DEPRECATED, wxS( "deprecated" ) }
};

View File

@ -104,9 +104,9 @@ PLUGIN_CONTENT_MANAGER::PLUGIN_CONTENT_MANAGER(
ReadEnvVar();
// Read and store pcm schema
wxFileName schema_file( PATHS::GetStockDataPath( true ), "pcm.v1.schema.json" );
wxFileName schema_file( PATHS::GetStockDataPath( true ), wxS( "pcm.v1.schema.json" ) );
schema_file.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
schema_file.AppendDir( "schemas" );
schema_file.AppendDir( wxS( "schemas" ) );
std::ifstream schema_stream( schema_file.GetFullPath().ToUTF8() );
nlohmann::json schema;

View File

@ -670,9 +670,9 @@ void PL_EDITOR_FRAME::DisplayGridMsg()
switch( GetUserUnits() )
{
case EDA_UNITS::INCHES: gridformatter = "grid %.3f"; break;
case EDA_UNITS::MILLIMETRES: gridformatter = "grid %.4f"; break;
default: gridformatter = "grid %f"; break;
case EDA_UNITS::INCHES: gridformatter = wxS( "grid %.3f" ); break;
case EDA_UNITS::MILLIMETRES: gridformatter = wxS( "grid %.4f" ); break;
default: gridformatter = wxS( "grid %f" ); break;
}
double grid = EDA_UNIT_UTILS::UI::ToUserUnit( drawSheetIUScale, GetUserUnits(),

View File

@ -269,36 +269,36 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.SetFlags( auiFlags );
// Rows; layers 4 - 6
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
.Top().Layer( 6 ) );
m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" )
m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( wxS( "AuxToolbar" ) )
.Top().Layer( 5 ) );
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) )
.Bottom().Layer( 6 ) );
// Columns; layers 1 - 3
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) )
.Left().Layer( 3 ) );
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( wxS( "ToolsToolbar" ) )
.Right().Layer( 3 ) );
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" )
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( wxS( "LayersManager" ) )
.Right().Layer( 4 )
.Caption( _( "Appearance" ) ).PaneBorder( false )
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Name( "SelectionFilter" )
m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Name( wxS( "SelectionFilter" ) )
.Right().Layer( 4 ).Position( 2 )
.Caption( _( "Selection Filter" ) ).PaneBorder( false )
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( "PropertiesManager" )
m_auimgr.AddPane( m_propertiesPanel, EDA_PANE().Name( wxS( "PropertiesManager" ) )
.Left().Layer( 5 ).Caption( _( "Properties" ) )
.PaneBorder( false ).MinSize( 240, -1 ).BestSize( 300, -1 ) );
// Center
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
.Center() );
@ -329,13 +329,13 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
{
if( settings->m_AuiPanels.right_panel_width > 0 )
{
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( "LayersManager" );
wxAuiPaneInfo& layersManager = m_auimgr.GetPane( wxS( "LayersManager" ) );
SetAuiPaneSize( m_auimgr, layersManager, settings->m_AuiPanels.right_panel_width, -1 );
}
if( settings->m_AuiPanels.properties_panel_width > 0 && m_propertiesPanel )
{
wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( "PropertiesManager" );
wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( wxS( "PropertiesManager" ) );
SetAuiPaneSize( m_auimgr, propertiesPanel,
settings->m_AuiPanels.properties_panel_width, -1 );
}
@ -1113,8 +1113,8 @@ void PCB_EDIT_FRAME::doCloseWindow()
// the Layer Manager
if( m_show_layer_manager_tools )
{
m_auimgr.GetPane( "LayersManager" ).Show( false );
m_auimgr.GetPane( "TabbedPanel" ).Show( false );
m_auimgr.GetPane( wxS( "LayersManager" ) ).Show( false );
m_auimgr.GetPane( wxS( "TabbedPanel" ) ).Show( false );
}
// Unlink the old project if needed
@ -2091,13 +2091,13 @@ wxString PCB_EDIT_FRAME::GetCurrentFileName() const
bool PCB_EDIT_FRAME::LayerManagerShown()
{
return m_auimgr.GetPane( "LayersManager" ).IsShown();
return m_auimgr.GetPane( wxS( "LayersManager" ) ).IsShown();
}
bool PCB_EDIT_FRAME::PropertiesShown()
{
return m_auimgr.GetPane( "PropertiesManager" ).IsShown();
return m_auimgr.GetPane( wxS( "PropertiesManager" ) ).IsShown();
}