Library Editor: fixed library manager synchronization to sym-lib-table
This commit is contained in:
parent
b229286313
commit
d3d2770093
|
@ -49,7 +49,7 @@ void LIB_MANAGER::Sync( bool aForce )
|
||||||
|
|
||||||
if( aForce || m_syncHash != libTableHash )
|
if( aForce || m_syncHash != libTableHash )
|
||||||
{
|
{
|
||||||
getAdapter()->Sync();
|
getAdapter()->Sync( aForce );
|
||||||
m_syncHash = libTableHash;
|
m_syncHash = libTableHash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ int LIB_MANAGER::GetLibraryHash( const wxString& aLibrary ) const
|
||||||
auto row = m_symbolTable->FindRow( aLibrary );
|
auto row = m_symbolTable->FindRow( aLibrary );
|
||||||
|
|
||||||
// return -1 if library does not exist or 0 if not modified
|
// return -1 if library does not exist or 0 if not modified
|
||||||
return row ? std::hash<std::string>{}( row->GetFullURI( true ).ToStdString() ) : -1;
|
return row ? std::hash<std::string>{}( aLibrary.ToStdString() + row->GetFullURI( true ).ToStdString() ) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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();
|
int libMgrHash = m_libMgr->GetHash();
|
||||||
|
|
||||||
if( m_lastSyncHash == libMgrHash )
|
if( !aForce && m_lastSyncHash == libMgrHash )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_lastSyncHash = libMgrHash;
|
m_lastSyncHash = libMgrHash;
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
|
|
||||||
void UpdateLibrary( const wxString& aLibraryName );
|
void UpdateLibrary( const wxString& aLibraryName );
|
||||||
|
|
||||||
void Sync();
|
void Sync( bool aForce = false );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void updateLibrary( CMP_TREE_NODE_LIB& aLibNode );
|
void updateLibrary( CMP_TREE_NODE_LIB& aLibNode );
|
||||||
|
|
Loading…
Reference in New Issue