forked from qt-creator/qt-creator
QmakeProjectManager: Remove some local aliases
... for ProjectTree functions. Change-Id: Ia3608e79e046a13305995bfc07eb32cbe53060cf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -53,16 +53,6 @@ using namespace TextEditor;
|
||||
|
||||
namespace QmakeProjectManager {
|
||||
|
||||
Node *QmakeManager::contextNode()
|
||||
{
|
||||
return ProjectTree::findCurrentNode();
|
||||
}
|
||||
|
||||
Project *QmakeManager::contextProject()
|
||||
{
|
||||
return ProjectTree::currentProject();
|
||||
}
|
||||
|
||||
static QmakeProFileNode *buildableFileProFile(Node *node)
|
||||
{
|
||||
if (node) {
|
||||
@@ -77,7 +67,7 @@ static QmakeProFileNode *buildableFileProFile(Node *node)
|
||||
|
||||
FileNode *QmakeManager::contextBuildableFileNode()
|
||||
{
|
||||
Node *node = contextNode();
|
||||
Node *node = ProjectTree::findCurrentNode();
|
||||
|
||||
QmakeProFileNode *subProjectNode = buildableFileProFile(node);
|
||||
FileNode *fileNode = node ? node->asFileNode() : nullptr;
|
||||
@@ -97,7 +87,7 @@ void QmakeManager::addLibraryContextMenu()
|
||||
{
|
||||
QString projectPath;
|
||||
|
||||
Node *node = contextNode();
|
||||
Node *node = ProjectTree::findCurrentNode();
|
||||
if (ContainerNode *cn = node->asContainerNode())
|
||||
projectPath = cn->project()->projectFilePath().toString();
|
||||
else if (dynamic_cast<QmakeProFileNode *>(node))
|
||||
@@ -142,7 +132,7 @@ void QmakeManager::runQMake()
|
||||
|
||||
void QmakeManager::runQMakeContextMenu()
|
||||
{
|
||||
runQMakeImpl(contextProject(), contextNode());
|
||||
runQMakeImpl(ProjectTree::currentProject(), ProjectTree::findCurrentNode());
|
||||
}
|
||||
|
||||
void QmakeManager::runQMakeImpl(ProjectExplorer::Project *p, ProjectExplorer::Node *node)
|
||||
@@ -206,8 +196,11 @@ void QmakeManager::buildFile()
|
||||
|
||||
void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isFileBuild)
|
||||
{
|
||||
handleSubDirContextMenu(action, isFileBuild, contextProject(),
|
||||
buildableFileProFile(contextNode()), contextBuildableFileNode());
|
||||
handleSubDirContextMenu(action,
|
||||
isFileBuild,
|
||||
ProjectTree::currentProject(),
|
||||
buildableFileProFile(ProjectTree::findCurrentNode()),
|
||||
contextBuildableFileNode());
|
||||
}
|
||||
|
||||
void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isFileBuild,
|
||||
|
@@ -48,8 +48,6 @@ public:
|
||||
void notifyChanged(const Utils::FileName &name);
|
||||
|
||||
// Context information used in the slot implementations
|
||||
static ProjectExplorer::Node *contextNode();
|
||||
static ProjectExplorer::Project *contextProject();
|
||||
static ProjectExplorer::FileNode *contextBuildableFileNode();
|
||||
|
||||
enum Action { BUILD, REBUILD, CLEAN };
|
||||
|
@@ -376,7 +376,7 @@ void QmakeProjectManagerPluginPrivate::updateContextActions()
|
||||
const auto *proFileNode = dynamic_cast<const QmakeProFileNode *>(containerNode ? containerNode->rootProjectNode() : node);
|
||||
|
||||
m_addLibraryActionContextMenu->setEnabled(proFileNode);
|
||||
auto *qmakeProject = qobject_cast<QmakeProject *>(QmakeManager::contextProject());
|
||||
auto *qmakeProject = qobject_cast<QmakeProject *>(project);
|
||||
QmakeProFileNode *subProjectNode = nullptr;
|
||||
disableBuildFileMenus();
|
||||
if (node) {
|
||||
|
Reference in New Issue
Block a user