Loading common/footprint_info.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -180,3 +180,26 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE& aTable ) return true; } bool FOOTPRINT_INFO::InLibrary( const wxString& aLibrary ) const { if( aLibrary.IsEmpty() ) return false; if( aLibrary == m_libName || aLibrary == m_libPath ) return true; wxFileName filename = aLibrary; if( filename.GetExt().IsEmpty() ) filename.SetExt( LegacyFootprintLibPathExtension ); if( filename.GetFullPath() == m_libPath ) return true; if( filename.GetPath().IsEmpty() ) filename = wxGetApp().FindLibraryPath( filename.GetFullName() ); return filename.GetFullPath() == m_libPath; } cvpcb/class_footprints_listbox.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a } if( (aFilterType & BY_LIBRARY) && !aLibName.IsEmpty() && (aList.GetItem( ii ).m_libName != aLibName) ) && !aList.GetItem( ii ).InLibrary( aLibName ) ) continue; if( (aFilterType & BY_COMPONENT) && (aComponent != NULL) Loading include/footprint_info.h +19 −7 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #ifndef FOOTPRINT_INFO_H_ #define FOOTPRINT_INFO_H_ #include <boost/ptr_container/ptr_vector.hpp> #include <boost/foreach.hpp> Loading Loading @@ -67,6 +68,17 @@ public: void SetLibraryPath( const wxString& aLibPath ) { m_libPath = aLibPath; } const wxString& GetLibraryPath() const { return m_libPath; } /** * Function InLibrary * tests if the #FOOTPRINT_INFO object was loaded from \a aLibrary. * * @param aLibrary is the file name or the fully qualified path and file name * to test. * @return true if the #FOOTPRINT_INFO object was loaded from \a aLibrary. Otherwise * false. */ bool InLibrary( const wxString& aLibrary ) const; }; Loading Loading
common/footprint_info.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -180,3 +180,26 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE& aTable ) return true; } bool FOOTPRINT_INFO::InLibrary( const wxString& aLibrary ) const { if( aLibrary.IsEmpty() ) return false; if( aLibrary == m_libName || aLibrary == m_libPath ) return true; wxFileName filename = aLibrary; if( filename.GetExt().IsEmpty() ) filename.SetExt( LegacyFootprintLibPathExtension ); if( filename.GetFullPath() == m_libPath ) return true; if( filename.GetPath().IsEmpty() ) filename = wxGetApp().FindLibraryPath( filename.GetFullName() ); return filename.GetFullPath() == m_libPath; }
cvpcb/class_footprints_listbox.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a } if( (aFilterType & BY_LIBRARY) && !aLibName.IsEmpty() && (aList.GetItem( ii ).m_libName != aLibName) ) && !aList.GetItem( ii ).InLibrary( aLibName ) ) continue; if( (aFilterType & BY_COMPONENT) && (aComponent != NULL) Loading
include/footprint_info.h +19 −7 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #ifndef FOOTPRINT_INFO_H_ #define FOOTPRINT_INFO_H_ #include <boost/ptr_container/ptr_vector.hpp> #include <boost/foreach.hpp> Loading Loading @@ -67,6 +68,17 @@ public: void SetLibraryPath( const wxString& aLibPath ) { m_libPath = aLibPath; } const wxString& GetLibraryPath() const { return m_libPath; } /** * Function InLibrary * tests if the #FOOTPRINT_INFO object was loaded from \a aLibrary. * * @param aLibrary is the file name or the fully qualified path and file name * to test. * @return true if the #FOOTPRINT_INFO object was loaded from \a aLibrary. Otherwise * false. */ bool InLibrary( const wxString& aLibrary ) const; }; Loading