Check for file moving directory and refresh entire tree if so.

Fixes: lp:1852431
* https://bugs.launchpad.net/kicad/+bug/1852431
This commit is contained in:
Jeff Young 2019-11-13 18:07:51 +00:00
parent f4a1fef3b0
commit 8ce04d3362
1 changed files with 8 additions and 1 deletions

View File

@ -699,8 +699,15 @@ void TREE_PROJECT_FRAME::OnRenameFile( wxCommandEvent& )
if( buffer.IsEmpty() )
return; // empty file name not allowed
wxString oldDir = tree_data->GetDir();
if( tree_data->Rename( buffer, true ) )
m_TreeProject->SetItemText( curr_item, buffer );
{
if( tree_data->GetDir() != oldDir )
ReCreateTreePrj();
else
m_TreeProject->SetItemText( curr_item, buffer );
}
}