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:
Christian Stenger
2019-03-19 15:36:07 +01:00
parent e94f5b496e
commit 5944c7f0f6
3 changed files with 4 additions and 4 deletions

View File

@@ -62,6 +62,8 @@ namespace Internal {
class CMakeProjectPluginPrivate
{
public:
CMakeToolManager cmakeToolManager; // have that before the first CMakeKitAspect
Utils::ParameterAction *m_buildTargetContextAction = nullptr;
QMetaObject::Connection m_actionConnect;
@@ -112,8 +114,6 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
tr("CMake", "SnippetProvider"));
ProjectManager::registerProjectType<CMakeProject>(Constants::CMAKEPROJECTMIMETYPE);
new CMakeToolManager(this);
//menus
ActionContainer *msubproject =
ActionManager::actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);

View File

@@ -57,7 +57,7 @@ static CMakeToolManagerPrivate *d = nullptr;
CMakeToolManager *CMakeToolManager::m_instance = nullptr;
CMakeToolManager::CMakeToolManager(QObject *parent) : QObject(parent)
CMakeToolManager::CMakeToolManager()
{
QTC_ASSERT(!m_instance, return);
m_instance = this;

View File

@@ -40,7 +40,7 @@ class CMAKE_EXPORT CMakeToolManager : public QObject
{
Q_OBJECT
public:
CMakeToolManager(QObject *parent);
CMakeToolManager();
~CMakeToolManager() override;
static CMakeToolManager *instance();