forked from qt-creator/qt-creator
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 <florian@apolloner.eu> Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -117,12 +117,12 @@ void CMakeProjectPlugin::updateContextActions(ProjectExplorer::Node *node,
|
|||||||
CMakeProject *cmProject = dynamic_cast<CMakeProject *>(project);
|
CMakeProject *cmProject = dynamic_cast<CMakeProject *>(project);
|
||||||
|
|
||||||
// Build Target:
|
// Build Target:
|
||||||
disconnect(m_buildTargetContextAction);
|
disconnect(m_actionConnect);
|
||||||
m_buildTargetContextAction->setParameter(targetDisplayName);
|
m_buildTargetContextAction->setParameter(targetDisplayName);
|
||||||
m_buildTargetContextAction->setEnabled(targetNode);
|
m_buildTargetContextAction->setEnabled(targetNode);
|
||||||
m_buildTargetContextAction->setVisible(targetNode);
|
m_buildTargetContextAction->setVisible(targetNode);
|
||||||
if (cmProject && targetNode) {
|
if (cmProject && targetNode) {
|
||||||
connect(m_buildTargetContextAction, &Utils::ParameterAction::triggered,
|
m_actionConnect = connect(m_buildTargetContextAction, &Utils::ParameterAction::triggered,
|
||||||
cmProject, [cmProject, targetDisplayName]() { cmProject->buildCMakeTarget(targetDisplayName); });
|
cmProject, [cmProject, targetDisplayName]() { cmProject->buildCMakeTarget(targetDisplayName); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,6 +66,7 @@ private:
|
|||||||
void updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
|
void updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
|
||||||
|
|
||||||
Utils::ParameterAction *m_buildTargetContextAction = nullptr;
|
Utils::ParameterAction *m_buildTargetContextAction = nullptr;
|
||||||
|
QMetaObject::Connection m_actionConnect;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user