aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmakeprojectmanager
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-02-27 15:57:26 +0100
committerhjk <hjk@qt.io>2020-03-19 10:13:18 +0000
commitbc79ec1ee2f7c76fbc0ec19094a5bf5386bf2e84 (patch)
tree99189d340e221995a7256cbab849b2e7191034e5 /src/plugins/qmakeprojectmanager
parentef6af1b7df7374eab6bb85a2fa80dd3a5e12e2a2 (diff)
Qmake: Use a QmakeProFileNode instead of a generic node
... in handleSubDirContextMenu overload, obsoleting one cast there. Change-Id: Ic6e8bfeee0fa2f8838a29df8123efe10f2faefd4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmakeprojectmanager')
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp22
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h10
2 files changed, 16 insertions, 16 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp
index e1899418dd..35862044dc 100644
--- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp
@@ -141,7 +141,7 @@ public:
void handleSubDirContextMenu(Action action, bool isFileBuild);
static void handleSubDirContextMenu(Action action, bool isFileBuild,
Project *contextProject,
- Node *contextProFileNode,
+ QmakeProFileNode *profile,
FileNode *buildableFile);
void addLibraryImpl(const QString &fileName, TextEditor::BaseTextEditor *editor);
void runQMakeImpl(Project *p, ProjectExplorer::Node *node);
@@ -477,7 +477,7 @@ void QmakeProjectManagerPluginPrivate::buildFile()
}
}
-void QmakeProjectManagerPlugin::buildProduct(Project *project, Node *proFileNode)
+void QmakeProjectManagerPlugin::buildProduct(Project *project, QmakeProFileNode *proFileNode)
{
QmakeProjectManagerPluginPrivate::handleSubDirContextMenu(
QmakeProjectManagerPluginPrivate::BUILD, false, project, proFileNode, nullptr);
@@ -500,9 +500,11 @@ void QmakeProjectManagerPluginPrivate::handleSubDirContextMenu(Action action, bo
buildableFileNode);
}
-void QmakeProjectManagerPluginPrivate::handleSubDirContextMenu(Action action, bool isFileBuild,
- Project *contextProject, Node *contextNode,
- FileNode *buildableFile)
+void QmakeProjectManagerPluginPrivate::handleSubDirContextMenu(Action action,
+ bool isFileBuild,
+ Project *contextProject,
+ QmakeProFileNode *profile,
+ FileNode *buildableFile)
{
QTC_ASSERT(contextProject, return);
Target *target = contextProject->activeTarget();
@@ -513,14 +515,12 @@ void QmakeProjectManagerPluginPrivate::handleSubDirContextMenu(Action action, bo
if (!bc)
return;
- if (!contextNode || !buildableFile)
+ if (!profile || !buildableFile)
isFileBuild = false;
- if (auto *prifile = dynamic_cast<QmakePriFileNode *>(contextNode)) {
- if (QmakeProFileNode *profile = prifile->proFileNode()) {
- if (profile != contextProject->rootProjectNode() || isFileBuild)
- bc->setSubNodeBuild(profile->proFileNode());
- }
+ if (profile) {
+ if (profile != contextProject->rootProjectNode() || isFileBuild)
+ bc->setSubNodeBuild(profile->proFileNode());
}
if (isFileBuild)
diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h
index 1d11bb45cb..9cab4ae849 100644
--- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h
+++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.h
@@ -27,12 +27,12 @@
#include <extensionsystem/iplugin.h>
-namespace ProjectExplorer {
-class Project;
-class Node;
-} // ProjectExplorer
+namespace ProjectExplorer { class Project; }
namespace QmakeProjectManager {
+
+class QmakeProFileNode;
+
namespace Internal {
class QmakeProjectManagerPlugin final : public ExtensionSystem::IPlugin
@@ -43,7 +43,7 @@ class QmakeProjectManagerPlugin final : public ExtensionSystem::IPlugin
public:
~QmakeProjectManagerPlugin() final;
- static void buildProduct(ProjectExplorer::Project *project, ProjectExplorer::Node *proFileNode);
+ static void buildProduct(ProjectExplorer::Project *project, QmakeProFileNode *proFileNode);
#ifdef WITH_TESTS
private slots: