ProjectExplorer: Remove arguments from node change signals

This discourages storing the pointers needlessly. The items
are still easy accessible by the static ProjectTree::currentNode()

Change-Id: I3c0cd019e9fdc382afacbc9d9de3b97d5f58ae1e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-02-24 10:02:39 +01:00
parent a7809d4f5e
commit 6d723dfa6f
10 changed files with 46 additions and 63 deletions

View File

@@ -315,8 +315,10 @@ void QmakeProjectManagerPlugin::updateRunQMakeAction()
m_runQMakeAction->setEnabled(enable);
}
void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project)
void QmakeProjectManagerPlugin::updateContextActions()
{
Node *node = ProjectTree::currentNode();
Project *project = ProjectTree::currentProject();
m_addLibraryActionContextMenu->setEnabled(dynamic_cast<QmakeProFileNode *>(node));
auto proFileNode = dynamic_cast<QmakeProFileNode *>(node);
@@ -377,10 +379,9 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
void QmakeProjectManagerPlugin::buildStateChanged(ProjectExplorer::Project *pro)
{
ProjectExplorer::Project *currentProject = ProjectTree::currentProject();
if (pro == currentProject) {
if (pro == ProjectTree::currentProject()) {
updateRunQMakeAction();
updateContextActions(ProjectTree::currentNode(), pro);
updateContextActions();
updateBuildFileAction();
}
}