data: Readded manual element clearing when clearing file nodes
This commit is contained in:
@@ -160,6 +160,14 @@ void SqliteStorage::removeNameHierarchyElement(Id id)
|
||||
).c_str());
|
||||
}
|
||||
|
||||
void SqliteStorage::removeElementsWithLocationInFiles(const std::vector<Id>& fileIds)
|
||||
{
|
||||
m_database.execDML((
|
||||
"DELETE FROM element WHERE id IN (SELECT element_id FROM source_location "
|
||||
"WHERE source_location.file_node_id IN (" + utility::join(utility::toStrings(fileIds), ',') + "));"
|
||||
).c_str());
|
||||
}
|
||||
|
||||
void SqliteStorage::removeFile(Id id)
|
||||
{
|
||||
if (isFile(id))
|
||||
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
|
||||
void removeElement(Id id);
|
||||
void removeNameHierarchyElement(Id id);
|
||||
void removeElementsWithLocationInFiles(const std::vector<Id>& fileIds);
|
||||
void removeFile(Id id);
|
||||
void removeFiles(const std::vector<Id>& fileIds);
|
||||
void removeUnusedNameHierarchyElements();
|
||||
|
||||
@@ -87,6 +87,7 @@ void Storage::clearFileElements(const std::vector<FilePath>& filePaths)
|
||||
|
||||
if (fileNodeIds.size())
|
||||
{
|
||||
m_sqliteStorage.removeElementsWithLocationInFiles(fileNodeIds);
|
||||
m_sqliteStorage.removeFiles(fileNodeIds);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user