forked from qt-creator/qt-creator
CompilationDbProjectManager: Sanitize project parsing
The parsing code used to access all kinds of stuff (e.g. the project tree and the toolchain manager) from the non-UI thread, which is not allowed. Fixes: QTCREATORBUG-22420 Change-Id: I4be47919d7e543376d31826dd380f66f4e060458 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -25,14 +25,19 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "compilationdatabaseutils.h"
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/treescanner.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QTimer;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace CppTools {
|
||||
class CppProjectUpdater;
|
||||
}
|
||||
@@ -43,6 +48,7 @@ class Kit;
|
||||
|
||||
namespace CompilationDatabaseProjectManager {
|
||||
namespace Internal {
|
||||
class CompilationDbParser;
|
||||
|
||||
class CompilationDatabaseProject : public ProjectExplorer::Project
|
||||
{
|
||||
@@ -58,15 +64,16 @@ private:
|
||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
||||
|
||||
void reparseProject();
|
||||
void buildTreeAndProjectParts(const Utils::FileName &projectFile);
|
||||
void buildTreeAndProjectParts();
|
||||
Utils::FileName rootPathFromSettings() const;
|
||||
|
||||
QFutureWatcher<void> m_parserWatcher;
|
||||
std::unique_ptr<CppTools::CppProjectUpdater> m_cppCodeModelUpdater;
|
||||
std::unique_ptr<ProjectExplorer::Kit> m_kit;
|
||||
Utils::FileSystemWatcher m_fileSystemWatcher;
|
||||
ProjectExplorer::TreeScanner m_treeScanner;
|
||||
QHash<QString, bool> m_mimeBinaryCache;
|
||||
MimeBinaryCache m_mimeBinaryCache;
|
||||
QTimer * const m_parseDelay;
|
||||
CompilationDbParser *m_parser = nullptr;
|
||||
bool m_hasTarget = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user