From bab4564dfff1e8c51135f8dececd743b20fddfc7 Mon Sep 17 00:00:00 2001 From: charras Date: Wed, 17 Feb 2010 17:47:12 +0000 Subject: [PATCH] see changelog --- CHANGELOG.txt | 13 +++++++++++++ kicad/treeprj_frame.cpp | 29 +++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4e49deeff4..c38356f8ea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,19 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with email address. + +2010-Feb-17 UPDATE Jean-Pierre Charras +================================================================================ +kicad: + * Building the tree project can be *very* long if there are a lot of + * subdirectories in the working directory. + * Unfornately, this happens easily if the project file *.pro + * is in the home directory + * when subdirs are not loaded, double click on a directory to load its files and subdirs + * #define ADD_FILES_IN_SUBDIRS was used ubtil now. + * is now commented, so one must double click on a subdir name to load its files + * See treeprj_frme.cpp for more info + 2010-Feb-17 UPDATE Jean-Pierre Charras ================================================================================ Eeschema, libedit: fixed last problems when editing alias info. diff --git a/kicad/treeprj_frame.cpp b/kicad/treeprj_frame.cpp index 737f9fe29c..462fc00cf2 100644 --- a/kicad/treeprj_frame.cpp +++ b/kicad/treeprj_frame.cpp @@ -8,6 +8,7 @@ #include #endif +#include #include "fctsys.h" #include "gr_basic.h" #include "common.h" @@ -26,9 +27,18 @@ #include "wx/dir.h" -// Comment this if you do no want to load subdirs files in the tree project -// UnComment this to load subdirs files in the tree project -#define ADD_FILES_IN_SUBDIRS +/* Comment this if you do no want to load subdirs files in the tree project + * UnComment this to load subdirs files in the tree project + * Building the tree project can be *very* long if there are a lot of subdirectories + * in the working directory. + * Unfornately, this happens easily if the project file *.pro is in the home directory + * when subdirs are not built, double click on a directory to load its files and subdirs + */ + +// #define ADD_FILES_IN_SUBDIRS + +// TODO: a better way could be to load current dir and first subdirs, and load +// load subdir filenames on opening a subdir // list of files extensions listed in the tree project window // *.sch files are always allowed, do not add here @@ -724,6 +734,13 @@ bool WinEDA_PrjFrame::AddFile( const wxString& name, wxTreeItemId& root ) // Check the file type TreeFileType type = TREE_UNKNOWN; + // Skip not visible files and dirs + wxFileName fn(name); + // Files/dirs names starting by "." are not visible files under unices. + // Skip them also under Windows + if( fn.GetName().StartsWith(wxT(".") ) ) + return false; + if( wxDirExists( name ) ) { type = TREE_DIRECTORY; @@ -845,7 +862,7 @@ bool WinEDA_PrjFrame::AddFile( const wxString& name, wxTreeItemId& root ) #ifdef KICAD_PYTHON PyHandler::GetInstance()->TriggerEvent( wxT( "kicad::TreeAddFile" ), PyHandler::Convert( name ) ); -#endif /* KICAD_YTHON */ +#endif /* KICAD_PYTHON */ // When enabled This section adds dirs and files found in the subdirs @@ -892,6 +909,10 @@ void WinEDA_PrjFrame::ReCreateTreePrj() else m_TreeProject->DeleteAllItems(); + // Do not update the frame while building the project tree + // This can take a while if there is a lot of files and directories in CWD + wxWindowUpdateLocker noUpdateTree( this ); + if( !m_Parent->m_ProjectFileName.IsOk() ) { fn.Clear();