From 6bf41574914e9e0720a99971ec5110d2a4854e32 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 9 Dec 2016 03:05:07 +0100 Subject: [PATCH] CMake: fix not disconnected build action The old code was disconnecting all signals from CMakeProjectPlugin to m_buildTargetContextAction. The result was more and more triggered actions. Change-Id: I8d7db5852c03d5388870a7460efb3a8a28fd0749 Reviewed-by: Florian Apolloner Reviewed-by: Alexander Drozdov Reviewed-by: Tobias Hunger --- src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp | 6 +++--- src/plugins/cmakeprojectmanager/cmakeprojectplugin.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 96224f009cf..c9851dd34b9 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(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 84af89f7334..5c5fb6bd8c8 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