From d3d277009314a32ad230149dc18f2323a777b1ef Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 14 Nov 2017 17:21:38 +0100 Subject: [PATCH] Library Editor: fixed library manager synchronization to sym-lib-table --- eeschema/lib_manager.cpp | 4 ++-- eeschema/lib_manager_adapter.cpp | 4 ++-- eeschema/lib_manager_adapter.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eeschema/lib_manager.cpp b/eeschema/lib_manager.cpp index 169fed0f06..4a02b975b0 100644 --- a/eeschema/lib_manager.cpp +++ b/eeschema/lib_manager.cpp @@ -49,7 +49,7 @@ void LIB_MANAGER::Sync( bool aForce ) if( aForce || m_syncHash != libTableHash ) { - getAdapter()->Sync(); + getAdapter()->Sync( aForce ); m_syncHash = libTableHash; } } @@ -76,7 +76,7 @@ int LIB_MANAGER::GetLibraryHash( const wxString& aLibrary ) const auto row = m_symbolTable->FindRow( aLibrary ); // return -1 if library does not exist or 0 if not modified - return row ? std::hash{}( row->GetFullURI( true ).ToStdString() ) : -1; + return row ? std::hash{}( aLibrary.ToStdString() + row->GetFullURI( true ).ToStdString() ) : -1; } diff --git a/eeschema/lib_manager_adapter.cpp b/eeschema/lib_manager_adapter.cpp index 3c1e8f380e..9243d79202 100644 --- a/eeschema/lib_manager_adapter.cpp +++ b/eeschema/lib_manager_adapter.cpp @@ -79,11 +79,11 @@ bool LIB_MANAGER_ADAPTER::IsContainer( const wxDataViewItem& aItem ) const } -void LIB_MANAGER_ADAPTER::Sync() +void LIB_MANAGER_ADAPTER::Sync( bool aForce ) { int libMgrHash = m_libMgr->GetHash(); - if( m_lastSyncHash == libMgrHash ) + if( !aForce && m_lastSyncHash == libMgrHash ) return; m_lastSyncHash = libMgrHash; diff --git a/eeschema/lib_manager_adapter.h b/eeschema/lib_manager_adapter.h index 57636a4b3f..074cd1e149 100644 --- a/eeschema/lib_manager_adapter.h +++ b/eeschema/lib_manager_adapter.h @@ -45,7 +45,7 @@ public: void UpdateLibrary( const wxString& aLibraryName ); - void Sync(); + void Sync( bool aForce = false ); protected: void updateLibrary( CMP_TREE_NODE_LIB& aLibNode );