forked from qt-creator/qt-creator
ProjectExplorer: Use RAII pattern for parsing start/stop signalling
Change-Id: I13de537140f265db3e3d0ab1cd924d6897cd90c8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -43,14 +43,18 @@ using namespace Utils;
|
||||
namespace CompilationDatabaseProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
CompilationDbParser::CompilationDbParser(const QString &projectName, const FilePath &projectPath,
|
||||
const FilePath &rootPath, MimeBinaryCache &mimeBinaryCache,
|
||||
CompilationDbParser::CompilationDbParser(const QString &projectName,
|
||||
const FilePath &projectPath,
|
||||
const FilePath &rootPath,
|
||||
MimeBinaryCache &mimeBinaryCache,
|
||||
ProjectExplorer::Project::ParseGuard &&guard,
|
||||
QObject *parent)
|
||||
: QObject(parent),
|
||||
m_projectName(projectName),
|
||||
m_projectFilePath(projectPath),
|
||||
m_rootPath(rootPath),
|
||||
m_mimeBinaryCache(mimeBinaryCache)
|
||||
: QObject(parent)
|
||||
, m_projectName(projectName)
|
||||
, m_projectFilePath(projectPath)
|
||||
, m_rootPath(rootPath)
|
||||
, m_mimeBinaryCache(mimeBinaryCache)
|
||||
, m_guard(std::move(guard))
|
||||
{
|
||||
connect(&m_parserWatcher, &QFutureWatcher<void>::finished, this, [this] {
|
||||
m_dbContents = m_parserWatcher.result();
|
||||
@@ -112,6 +116,7 @@ void CompilationDbParser::stop()
|
||||
m_treeScanner->disconnect();
|
||||
m_treeScanner->future().cancel();
|
||||
}
|
||||
m_guard = {};
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user