data: fixed issues with errors in incomplete files

* fixed intermediatestorage merges might lose file indexed/complete information
* fixed changing file complete to true only possible if the file has no errors
* fixed clicking show errors for a file where no asociated errors were found showed all errors
This commit is contained in:
Eberhard Graether
2018-06-18 20:31:52 +02:00
parent 009404dd37
commit c4901b6a7f
11 changed files with 91 additions and 28 deletions
@@ -648,8 +648,14 @@ void SqliteIndexStorage::setFileIndexed(Id fileId, bool indexed)
);
}
void SqliteIndexStorage::setFileComplete(Id fileId, bool complete)
void SqliteIndexStorage::setFileCompleteIfNoError(Id fileId, const std::wstring& filePath, bool complete)
{
StorageError error = doGetFirst<StorageError>("WHERE file_path == '" + utility::encodeToUtf8(filePath) + "'");
if (error.id)
{
return;
}
executeStatement(
"UPDATE file SET complete = " + std::to_string(complete) + " WHERE id == " + std::to_string(fileId) + ";"
);