forked from qt-creator/qt-creator
CompilationDatabaseProjectManager: Fix cached state being unhandled
In this code, database file is being hashed and if hash stays the same, parser quickly returns ParseResult::Cached. But as database never gets read, source tree isn't being built, thus dbContents() never gets called I moved ParseGuard::markAsSuccess() call to the finish() method of parser, so we tell ProjectExplorer that parsing finished successfully on Cached state Change-Id: I7ea28017e653ac6e2d7f50047c09a6eb7ecda13f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -153,6 +153,9 @@ void CompilationDbParser::parserJobFinished()
|
||||
|
||||
void CompilationDbParser::finish(ParseResult result)
|
||||
{
|
||||
if (result != ParseResult::Failure)
|
||||
m_guard.markAsSuccess();
|
||||
|
||||
emit finished(result);
|
||||
deleteLater();
|
||||
}
|
||||
|
@@ -69,7 +69,6 @@ public:
|
||||
QList<ProjectExplorer::FileNode *> scannedFiles() const;
|
||||
DbContents dbContents() const
|
||||
{
|
||||
m_guard.markAsSuccess();
|
||||
return m_dbContents;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user