The _() macro affords some nullptr safety over a naked immediate.

Fixes: lp:1477448
* https://bugs.launchpad.net/kicad/+bug/1477448
This commit is contained in:
Jeff Young 2018-03-12 19:16:09 +00:00
parent b1f613071d
commit 4eedb3a27d
7 changed files with 20 additions and 27 deletions

View File

@ -735,11 +735,9 @@ void CVPCB_MAINFRAME::UpdateTitle()
if( fn.IsOk() && !prj.GetProjectFullName().IsEmpty() && fn.FileExists() )
{
title.Printf( L"Cvpcb \u2014 %s%s",
fn.GetFullPath(),
fn.IsFileWritable()
? wxString( wxEmptyString )
: _( " [Read Only]" ) );
title.Printf( _( "Cvpcb" ) + wxT( " \u2014 %s%s" ),
fn.GetFullPath(),
fn.IsFileWritable() ? wxEmptyString : _( " [Read Only]" ) );
}
else
{

View File

@ -1474,14 +1474,14 @@ void SCH_EDIT_FRAME::UpdateTitle()
if( GetScreen()->GetFileName() == m_DefaultSchematicFileName )
{
title.Printf( L"Eeschema \u2014 %s", GetChars( GetScreen()->GetFileName() ) );
title.Printf( _( "Eeschema \u2014 %s" ), GetChars( GetScreen()->GetFileName() ) );
}
else
{
wxString fileName = Prj().AbsolutePath( GetScreen()->GetFileName() );
wxFileName fn = fileName;
title.Printf( L"Eeschema \u2014 %s [%s] \u2014 %s",
title.Printf( _( "Eeschema \u2014 %s [%s] \u2014 %s" ),
GetChars( fn.GetName() ),
GetChars( m_CurrentSheet->PathHumanReadable() ),
GetChars( fn.GetPath() ) );

View File

@ -776,11 +776,9 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
else
{
wxString title;
title.Printf( L"GerbView \u2014 %s%s",
gerber->m_FileName,
gerber->m_IsX2_file
? " " + _( "(with X2 attributes)" )
: wxString( wxEmptyString ) );
title.Printf( _( "GerbView" ) + wxT( " \u2014 %s%s" ),
gerber->m_FileName,
gerber->m_IsX2_file ? _( " (with X2 attributes)" ) : wxEmptyString );
SetTitle( title );
gerber->DisplayImageInfo( this );

View File

@ -330,8 +330,8 @@ void PL_EDITOR_FRAME::UpdateTitleAndInfo()
wxString title;
wxString file = GetCurrFileName();
title.Printf( _( "Page Layout Editor" ) + L" \u2014 %s",
!!file ? file : _( "no file selected" ) );
title.Printf( _( "Page Layout Editor" ) + wxT( " \u2014 %s" ),
file.Length() ? file : _( "no file selected" ) );
SetTitle( title );
}

View File

@ -797,10 +797,10 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
}
wxString title;
title.Printf( _( "Footprint Editor" ) + L" \u2014 %s%s%s",
nickname_display,
writable ? wxString( wxEmptyString ) : _( " [Read Only]" ),
path_display );
title.Printf( _( "Footprint Editor" ) + wxT( " \u2014 %s%s%s" ),
nickname_display,
writable ? wxEmptyString : _( " [Read Only]" ),
path_display );
SetTitle( title );
}

View File

@ -688,9 +688,8 @@ void FOOTPRINT_VIEWER_FRAME::Update3D_Frame( bool aForceReloadFootprint )
if( draw3DFrame == NULL )
return;
wxString title = wxString::Format(
_( "3D Viewer" ) + L" \u2014 %s",
getCurFootprintName() );
wxString title = wxString::Format( _( "3D Viewer" ) + wxT( " \u2014 %s" ),
getCurFootprintName() );
draw3DFrame->SetTitle( title );

View File

@ -1112,9 +1112,7 @@ void PCB_EDIT_FRAME::UpdateTitle()
if( fileName.IsOk() && fileName.FileExists() )
{
fileinfo = fileName.IsFileWritable()
? wxString( wxEmptyString )
: _( " [Read Only]" );
fileinfo = fileName.IsFileWritable() ? wxEmptyString : _( " [Read Only]" );
}
else
{
@ -1122,9 +1120,9 @@ void PCB_EDIT_FRAME::UpdateTitle()
}
wxString title;
title.Printf( L"Pcbnew \u2014 %s%s",
fileName.GetFullPath(),
fileinfo );
title.Printf( _( "Pcbnew" ) + wxT( " \u2014 %s%s" ),
fileName.GetFullPath(),
fileinfo );
SetTitle( title );
}