kicad manager: fix broken Rename file command.
From master branch.
This commit is contained in:
parent
0df48f3002
commit
c41cd75b62
|
@ -123,10 +123,11 @@ bool PROJECT_TREE_ITEM::Rename( const wxString& name, bool check )
|
||||||
if( newFile == GetFileName() )
|
if( newFile == GetFileName() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// If required, prompt the user if the filename extension has changed:
|
||||||
wxString ext = PROJECT_TREE_PANE::GetFileExt( GetType() );
|
wxString ext = PROJECT_TREE_PANE::GetFileExt( GetType() );
|
||||||
wxRegEx reg( wxT( "^.*\\" ) + ext + wxT( "$" ), wxRE_ICASE );
|
wxString full_ext = wxT( "." ) + ext;
|
||||||
|
|
||||||
if( check && !ext.IsEmpty() && !reg.Matches( newFile ) )
|
if( check && !ext.IsEmpty() && !newFile.EndsWith( full_ext ) )
|
||||||
{
|
{
|
||||||
wxMessageDialog dialog( m_parent, _( "Changing file extension will change file type.\n"
|
wxMessageDialog dialog( m_parent, _( "Changing file extension will change file type.\n"
|
||||||
"Do you want to continue ?" ),
|
"Do you want to continue ?" ),
|
||||||
|
|
Loading…
Reference in New Issue