Clean up code inside the project manager tree

This commit is contained in:
Ian McInerney 2019-11-17 01:01:12 +00:00
parent 7b13eb46d8
commit c31ac6c154
3 changed files with 5 additions and 10 deletions

View File

@ -257,11 +257,8 @@ void TREE_PROJECT_FRAME::OnCreateNewDirectory( wxCommandEvent& event )
wxString full_dirname = prj_dir + wxFileName::GetPathSeparator() + subdir; wxString full_dirname = prj_dir + wxFileName::GetPathSeparator() + subdir;
if( wxMkdir( full_dirname ) ) // Make the new item and let the file watcher add it to the tree
{ wxMkdir( full_dirname );
// the new item will be added by the file watcher
// AddItemToTreeProject( subdir, root );
}
} }
@ -450,7 +447,7 @@ wxTreeItemId TREE_PROJECT_FRAME::AddItemToTreeProject( const wxString& aName,
if( dir.IsOpened() ) // protected dirs will not open properly. if( dir.IsOpened() ) // protected dirs will not open properly.
{ {
wxString dir_filename; wxString dir_filename;
data->SetPopulated( true ); data->SetPopulated( true );
@ -821,7 +818,7 @@ wxTreeItemId TREE_PROJECT_FRAME::findSubdirTreeItem( const wxString& aSubDir )
subdirs_id.pop(); subdirs_id.pop();
kid = m_TreeProject->GetFirstChild( root_id, cookie ); kid = m_TreeProject->GetFirstChild( root_id, cookie );
if( ! kid.IsOk() ) if( !kid.IsOk() )
continue; continue;
} }
} }

View File

@ -55,7 +55,7 @@ private:
bool m_isRenaming; // Are we in the process of renaming a file bool m_isRenaming; // Are we in the process of renaming a file
wxTreeItemId m_root; wxTreeItemId m_root;
std::vector<wxString> m_filters; std::vector<wxString> m_filters;
wxFileSystemWatcher* m_watcher; // file system watcher (since wxWidgets 2.9.2) wxFileSystemWatcher* m_watcher; // file system watcher
public: public:
TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent ); TREE_PROJECT_FRAME( KICAD_MANAGER_FRAME* parent );

View File

@ -37,8 +37,6 @@
*/ */
class TREEPROJECT_ITEM : public wxTreeItemData class TREEPROJECT_ITEM : public wxTreeItemData
{ {
//friend class KICAD_MANAGER_FRAME;
public: public:
TREEPROJECT_ITEM( TreeFileType type, const wxString& data, TREEPROJECT_ITEM( TreeFileType type, const wxString& data,