Skip to content

Commit

Permalink
ProjectExplorer: Remove arguments from node change signals
Browse files Browse the repository at this point in the history
This discourages storing the pointers needlessly. The items
are still easy accessible by the static ProjectTree::currentNode()

Change-Id: I3c0cd019e9fdc382afacbc9d9de3b97d5f58ae1e
Reviewed-by: Tobias Hunger <[email protected]>
  • Loading branch information
hjk authored and h4tr3d committed Feb 26, 2017
1 parent 9cff59d commit e1aa130
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 3 additions & 2 deletions cmakeprojectplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ void CMakeProjectPlugin::extensionsInitialized()
CMakeToolManager::restoreCMakeTools();
}

void CMakeProjectPlugin::updateContextActions(ProjectExplorer::Node *node,
ProjectExplorer::Project *project)
void CMakeProjectPlugin::updateContextActions()
{
Project *project = ProjectTree::currentProject();
Node *node = ProjectTree::currentNode();
CMakeTargetNode *targetNode = dynamic_cast<CMakeTargetNode *>(node);
// as targetNode can be deleted while the menu is open, we keep only the
const QString targetDisplayName = targetNode ? targetNode->displayName() : QString();
Expand Down
7 changes: 1 addition & 6 deletions cmakeprojectplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@

#include <QObject>

namespace ProjectExplorer {
class Node;
class Project;
} // namespace ProjectExplorer

namespace Utils { class ParameterAction; }

namespace CMakeProjectManager {
Expand Down Expand Up @@ -69,7 +64,7 @@ private slots:
#endif

private:
void updateContextActions(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
void updateContextActions();

Utils::ParameterAction *m_buildTargetContextAction = nullptr;
QMetaObject::Connection m_actionConnect;
Expand Down

0 comments on commit e1aa130

Please sign in to comment.