forked from qt-creator/qt-creator
CMakePM: Fix order of initialization
CMakeToolManager instance must be created first to avoid connects to a nullptr. Change-Id: If8738a26d58c80ffc9a63193240895f1bc9a87ae Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -62,6 +62,8 @@ namespace Internal {
|
|||||||
class CMakeProjectPluginPrivate
|
class CMakeProjectPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
CMakeToolManager cmakeToolManager; // have that before the first CMakeKitAspect
|
||||||
|
|
||||||
Utils::ParameterAction *m_buildTargetContextAction = nullptr;
|
Utils::ParameterAction *m_buildTargetContextAction = nullptr;
|
||||||
QMetaObject::Connection m_actionConnect;
|
QMetaObject::Connection m_actionConnect;
|
||||||
|
|
||||||
@@ -112,8 +114,6 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
|
|||||||
tr("CMake", "SnippetProvider"));
|
tr("CMake", "SnippetProvider"));
|
||||||
ProjectManager::registerProjectType<CMakeProject>(Constants::CMAKEPROJECTMIMETYPE);
|
ProjectManager::registerProjectType<CMakeProject>(Constants::CMAKEPROJECTMIMETYPE);
|
||||||
|
|
||||||
new CMakeToolManager(this);
|
|
||||||
|
|
||||||
//menus
|
//menus
|
||||||
ActionContainer *msubproject =
|
ActionContainer *msubproject =
|
||||||
ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
|
ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
|
||||||
|
@@ -57,7 +57,7 @@ static CMakeToolManagerPrivate *d = nullptr;
|
|||||||
|
|
||||||
CMakeToolManager *CMakeToolManager::m_instance = nullptr;
|
CMakeToolManager *CMakeToolManager::m_instance = nullptr;
|
||||||
|
|
||||||
CMakeToolManager::CMakeToolManager(QObject *parent) : QObject(parent)
|
CMakeToolManager::CMakeToolManager()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_instance, return);
|
QTC_ASSERT(!m_instance, return);
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
|
@@ -40,7 +40,7 @@ class CMAKE_EXPORT CMakeToolManager : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CMakeToolManager(QObject *parent);
|
CMakeToolManager();
|
||||||
~CMakeToolManager() override;
|
~CMakeToolManager() override;
|
||||||
|
|
||||||
static CMakeToolManager *instance();
|
static CMakeToolManager *instance();
|
||||||
|
Reference in New Issue
Block a user