From c31ac6c154ff7b8642e1e1d56c3579d3910ecf12 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 17 Nov 2019 01:01:12 +0000 Subject: [PATCH] Clean up code inside the project manager tree --- kicad/tree_project_frame.cpp | 11 ++++------- kicad/tree_project_frame.h | 2 +- kicad/treeproject_item.h | 2 -- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index c375968975..3796b8ccde 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -257,11 +257,8 @@ void TREE_PROJECT_FRAME::OnCreateNewDirectory( wxCommandEvent& event ) wxString full_dirname = prj_dir + wxFileName::GetPathSeparator() + subdir; - if( wxMkdir( full_dirname ) ) - { - // the new item will be added by the file watcher - // AddItemToTreeProject( subdir, root ); - } + // Make the new item and let the file watcher add it to the tree + wxMkdir( full_dirname ); } @@ -450,7 +447,7 @@ wxTreeItemId TREE_PROJECT_FRAME::AddItemToTreeProject( const wxString& aName, if( dir.IsOpened() ) // protected dirs will not open properly. { - wxString dir_filename; + wxString dir_filename; data->SetPopulated( true ); @@ -821,7 +818,7 @@ wxTreeItemId TREE_PROJECT_FRAME::findSubdirTreeItem( const wxString& aSubDir ) subdirs_id.pop(); kid = m_TreeProject->GetFirstChild( root_id, cookie ); - if( ! kid.IsOk() ) + if( !kid.IsOk() ) continue; } } diff --git a/kicad/tree_project_frame.h b/kicad/tree_project_frame.h index ec0928c7e4..2651a126b0 100644 --- a/kicad/tree_project_frame.h +++ b/kicad/tree_project_frame.h @@ -55,7 +55,7 @@ private: bool m_isRenaming; // Are we in the process of renaming a file wxTreeItemId m_root; std::vector m_filters; - wxFileSystemWatcher* m_watcher; // file system watcher (since wxWidgets 2.9.2) + wxFileSystemWatcher* m_watcher; // file system watcher public: TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent ); diff --git a/kicad/treeproject_item.h b/kicad/treeproject_item.h index 63b4f8ea44..ece6bd24ff 100644 --- a/kicad/treeproject_item.h +++ b/kicad/treeproject_item.h @@ -37,8 +37,6 @@ */ class TREEPROJECT_ITEM : public wxTreeItemData { - //friend class KICAD_MANAGER_FRAME; - public: TREEPROJECT_ITEM( TreeFileType type, const wxString& data,