7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 18:25:31 +00:00

Don't double-create new folders in project tree.

This commit is contained in:
Jeff Young 2025-01-16 16:18:15 +00:00
parent 89706aedae
commit af38f76f01
2 changed files with 8 additions and 4 deletions

View File

@ -222,7 +222,6 @@ public:
// Bring the Kicad manager frame back to the front
m_frame->Raise();
m_frame->RefreshProjectTree();
} );
}
@ -919,7 +918,6 @@ void PANEL_JOBSET::OnGenerateAllOutputsClick( wxCommandEvent& event )
// Bring the Kicad manager frame back to the front
m_frame->Raise();
m_frame->RefreshProjectTree();
} );
}

View File

@ -1286,6 +1286,13 @@ void PROJECT_TREE_PANE::onFileSystemEvent( wxFileSystemWatcherEvent& event )
wxString subdir = pathModified.GetPath();
wxString fn = pathModified.GetFullPath();
// Adjust directories to look like a file item (path and name).
if( pathModified.GetFullName().IsEmpty() )
{
subdir = subdir.BeforeLast( '/' );
fn = fn.BeforeLast( '/' );
}
switch( event.GetChangeType() )
{
case wxFSW_EVENT_DELETE:
@ -1314,8 +1321,7 @@ void PROJECT_TREE_PANE::onFileSystemEvent( wxFileSystemWatcherEvent& event )
{
case wxFSW_EVENT_CREATE:
{
wxTreeItemId newitem =
addItemToProjectTree( pathModified.GetFullPath(), root_id, nullptr, true );
wxTreeItemId newitem = addItemToProjectTree( fn, root_id, nullptr, true );
// If we are in the process of renaming a file, select the new one
// This is needed for MSW and OSX, since we don't get RENAME events from them, just a