summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp6
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprojectplugin.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp
index 96224f009c..c9851dd34b 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp
@@ -117,12 +117,12 @@ void CMakeProjectPlugin::updateContextActions(ProjectExplorer::Node *node,
CMakeProject *cmProject = dynamic_cast<CMakeProject *>(project);
// Build Target:
- disconnect(m_buildTargetContextAction);
+ disconnect(m_actionConnect);
m_buildTargetContextAction->setParameter(targetDisplayName);
m_buildTargetContextAction->setEnabled(targetNode);
m_buildTargetContextAction->setVisible(targetNode);
if (cmProject && targetNode) {
- connect(m_buildTargetContextAction, &Utils::ParameterAction::triggered,
- cmProject, [cmProject, targetDisplayName]() { cmProject->buildCMakeTarget(targetDisplayName); });
+ m_actionConnect = connect(m_buildTargetContextAction, &Utils::ParameterAction::triggered,
+ cmProject, [cmProject, targetDisplayName]() { cmProject->buildCMakeTarget(targetDisplayName); });
}
}
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h
index 84af89f733..5c5fb6bd8c 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h
+++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.h
@@ -66,6 +66,7 @@ private:
void updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
Utils::ParameterAction *m_buildTargetContextAction = nullptr;
+ QMetaObject::Connection m_actionConnect;
};
} // namespace Internal