forked from qt-creator/qt-creator
Clang: Remove PchManager
...which is the last dependency to libclang from the plugin. Change-Id: I173ee7e9621912ec88706b4cf62db2b1dbcf7610 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "clangprojectsettingspropertiespage.h"
|
||||
#include "constants.h"
|
||||
#include "pchmanager.h"
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
# include "test/clangcodecompletion_test.h"
|
||||
@@ -46,8 +45,6 @@
|
||||
|
||||
#include <texteditor/textmark.h>
|
||||
|
||||
#include <clang-c/Index.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
|
||||
@@ -61,23 +58,6 @@ void initializeTextMarks()
|
||||
Utils::Theme::ClangCodeModel_Error_TextMarkColor);
|
||||
}
|
||||
|
||||
static bool clangInitialised = false;
|
||||
static QMutex initialisationMutex;
|
||||
|
||||
void initializeClang()
|
||||
{
|
||||
if (clangInitialised)
|
||||
return;
|
||||
|
||||
QMutexLocker locker(&initialisationMutex);
|
||||
if (clangInitialised)
|
||||
return;
|
||||
|
||||
clang_toggleCrashRecovery(1);
|
||||
clang_enableStackTraces();
|
||||
clangInitialised = true;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
@@ -92,19 +72,8 @@ bool ClangCodeModelPlugin::initialize(const QStringList &arguments, QString *err
|
||||
panelFactory->setSimpleCreateWidgetFunction<ClangProjectSettingsWidget>(QIcon());
|
||||
ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
|
||||
|
||||
// Initialize Clang
|
||||
ClangCodeModel::Internal::initializeClang();
|
||||
|
||||
// Set up PchManager
|
||||
PchManager *pchManager = new PchManager(this);
|
||||
ProjectExplorer::SessionManager *sessionManager = ProjectExplorer::SessionManager::instance();
|
||||
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
|
||||
pchManager, &PchManager::onAboutToRemoveProject);
|
||||
auto cppModelManager = CppTools::CppModelManager::instance();
|
||||
connect(cppModelManager, &CppTools::CppModelManager::projectPartsUpdated,
|
||||
pchManager, &PchManager::onProjectPartsUpdated);
|
||||
|
||||
// Register ModelManagerSupportProvider
|
||||
auto cppModelManager = CppTools::CppModelManager::instance();
|
||||
cppModelManager->setClangModelManagerSupportProvider(&m_modelManagerSupportProvider);
|
||||
|
||||
initializeTextMarks();
|
||||
|
||||
Reference in New Issue
Block a user