data: avoid duplicate access components

* added check to make sure that an access component does not already exist before inserting it into the database
This commit is contained in:
malte_langkabel
2016-08-12 15:36:48 +02:00
parent 279fc7ae82
commit 5c0ed7f7f2
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -121,7 +121,10 @@ void PersistentStorage::addSourceLocation(
void PersistentStorage::addComponentAccess(Id nodeId , int type)
{
m_sqliteStorage.addComponentAccess(nodeId, type);
if (m_sqliteStorage.getComponentAccessByNodeId(nodeId).nodeId == 0)
{
m_sqliteStorage.addComponentAccess(nodeId, type);
}
}
void PersistentStorage::addCommentLocation(Id fileNodeId, uint startLine, uint startCol, uint endLine, uint endCol)