forked from qt-creator/qt-creator
CppTools: Use a normal plugin pimpl member for CppModelManager
Change-Id: Id2c4b098084808070ef91de13c8338184e52141d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -465,14 +465,6 @@ CppModelManager *CppModelManager::instance()
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
void CppModelManager::createCppModelManager(Internal::CppToolsPlugin *parent)
|
||||
{
|
||||
QTC_ASSERT(!m_instance, return;);
|
||||
m_instance = new CppModelManager();
|
||||
m_instance->initCppTools();
|
||||
m_instance->setParent(parent);
|
||||
}
|
||||
|
||||
void CppModelManager::initCppTools()
|
||||
{
|
||||
// Objects
|
||||
@@ -512,6 +504,8 @@ CppModelManager::CppModelManager()
|
||||
: CppModelManagerBase(nullptr)
|
||||
, d(new CppModelManagerPrivate)
|
||||
{
|
||||
m_instance = this;
|
||||
|
||||
// Used for weak dependency in VcsBaseSubmitEditor
|
||||
setObjectName("CppModelManager");
|
||||
ExtensionSystem::PluginManager::addObject(this);
|
||||
@@ -562,6 +556,8 @@ CppModelManager::CppModelManager()
|
||||
initializeBuiltinModelManagerSupport();
|
||||
|
||||
d->m_internalIndexingSupport = new BuiltinIndexingSupport;
|
||||
|
||||
initCppTools();
|
||||
}
|
||||
|
||||
CppModelManager::~CppModelManager()
|
||||
|
@@ -68,7 +68,7 @@ class WorkingCopy;
|
||||
namespace Internal {
|
||||
class CppSourceProcessor;
|
||||
class CppModelManagerPrivate;
|
||||
class CppToolsPlugin;
|
||||
class CppToolsPluginPrivate;
|
||||
}
|
||||
|
||||
namespace Tests {
|
||||
@@ -88,15 +88,15 @@ class CPPTOOLS_EXPORT CppModelManager final : public CPlusPlus::CppModelManagerB
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
using Document = CPlusPlus::Document;
|
||||
|
||||
public:
|
||||
private:
|
||||
friend class Internal::CppToolsPluginPrivate;
|
||||
CppModelManager();
|
||||
~CppModelManager() override;
|
||||
|
||||
public:
|
||||
using Document = CPlusPlus::Document;
|
||||
|
||||
static CppModelManager *instance();
|
||||
static void createCppModelManager(Internal::CppToolsPlugin *parent);
|
||||
|
||||
// Documented in source file.
|
||||
enum ProgressNotificationMode {
|
||||
|
@@ -82,7 +82,6 @@ class CppToolsPluginPrivate
|
||||
public:
|
||||
CppToolsPluginPrivate()
|
||||
{
|
||||
CppModelManager::createCppModelManager(m_instance);
|
||||
m_settings = new CppToolsSettings(m_instance); // force registration of cpp tools settings
|
||||
m_codeModelSettings.fromSettings(ICore::settings());
|
||||
m_cppCodeStyleSettingsPage = new CppCodeStyleSettingsPage;
|
||||
@@ -96,6 +95,7 @@ public:
|
||||
}
|
||||
|
||||
StringTable stringTable;
|
||||
CppModelManager modelManager;
|
||||
CppCodeModelSettings m_codeModelSettings;
|
||||
CppToolsSettings *m_settings = nullptr;
|
||||
CppFileSettings m_fileSettings;
|
||||
|
Reference in New Issue
Block a user