ProjectExplorer: Flip default for ProjectNode::showInSimpleTree

Change-Id: Ibd4f91ad55b2be93d20dfc4f583de95274e981ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-28 17:32:00 +01:00
parent 28fd0bbbb9
commit e3a7aa1ad2
14 changed files with 5 additions and 152 deletions

View File

@@ -28,7 +28,6 @@
#include "autotoolsproject.h"
#include "autotoolsbuildconfiguration.h"
#include "autotoolsprojectconstants.h"
#include "autotoolsprojectnode.h"
#include "autotoolsopenprojectwizard.h"
#include "makestep.h"
#include "makefileparserthread.h"
@@ -40,6 +39,7 @@
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/target.h>
#include <projectexplorer/headerpath.h>
#include <extensionsystem/pluginmanager.h>
@@ -207,7 +207,7 @@ void AutotoolsProject::makefileParsingFinished()
m_watchedFiles.append(absConfigureAc);
}
auto newRoot = std::make_unique<AutotoolsProjectNode>(projectDirectory());
auto newRoot = std::make_unique<ProjectNode>(projectDirectory());
for (const QString &f : m_files) {
const Utils::FileName path = Utils::FileName::fromString(f);
newRoot->addNestedNode(std::make_unique<FileNode>(path,

View File

@@ -2,7 +2,6 @@ include(../../qtcreatorplugin.pri)
HEADERS = autotoolsprojectplugin.h\
autotoolsopenprojectwizard.h\
autotoolsprojectnode.h\
autotoolsproject.h\
autotoolsbuildsettingswidget.h\
autotoolsbuildconfiguration.h\
@@ -13,9 +12,9 @@ HEADERS = autotoolsprojectplugin.h\
configurestep.h\
makefileparserthread.h\
makefileparser.h
SOURCES = autotoolsprojectplugin.cpp\
autotoolsopenprojectwizard.cpp\
autotoolsprojectnode.cpp\
autotoolsproject.cpp\
autotoolsbuildsettingswidget.cpp\
autotoolsbuildconfiguration.cpp\

View File

@@ -25,8 +25,6 @@ QtcPlugin {
"autotoolsproject.cpp",
"autotoolsproject.h",
"autotoolsprojectconstants.h",
"autotoolsprojectnode.cpp",
"autotoolsprojectnode.h",
"autotoolsprojectplugin.cpp",
"autotoolsprojectplugin.h",
"configurestep.cpp",

View File

@@ -1,44 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 Openismus GmbH.
** Author: Peter Penz (ppenz@openismus.com)
** Author: Patricia Santana Cruz (patriciasantanacruz@gmail.com)
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "autotoolsprojectnode.h"
#include "autotoolsproject.h"
#include <coreplugin/idocument.h>
using namespace AutotoolsProjectManager;
using namespace AutotoolsProjectManager::Internal;
using namespace ProjectExplorer;
AutotoolsProjectNode::AutotoolsProjectNode(const Utils::FileName &projectDirectory) :
ProjectNode(projectDirectory)
{ }
bool AutotoolsProjectNode::showInSimpleTree() const
{
return true;
}

View File

@@ -1,57 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 Openismus GmbH.
** Author: Peter Penz (ppenz@openismus.com)
** Author: Patricia Santana Cruz (patriciasantanacruz@gmail.com)
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <projectexplorer/projectnodes.h>
namespace Core { class IDocument; }
namespace AutotoolsProjectManager {
namespace Internal {
class AutotoolsProject;
/**
* @brief Implementation of the ProjectExplorer::ProjectNode interface.
*
* A project node represents a file or a folder of the project tree.
* No special operations (addFiles(), removeFiles(), renameFile(), ..)
* are offered.
*
* @see AutotoolsProject
*/
class AutotoolsProjectNode : public ProjectExplorer::ProjectNode
{
public:
AutotoolsProjectNode(const Utils::FileName &projectDirectory);
bool showInSimpleTree() const override;
};
} // namespace Internal
} // namespace AutotoolsProjectManager

View File

@@ -115,11 +115,6 @@ CMakeInputsNode::CMakeInputsNode(const Utils::FileName &cmakeLists) :
setListInProject(false);
}
bool CMakeInputsNode::showInSimpleTree() const
{
return true;
}
CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) :
ProjectExplorer::ProjectNode(cmakeListPath)
{
@@ -152,11 +147,6 @@ CMakeProjectNode::CMakeProjectNode(const Utils::FileName &directory) :
setListInProject(false);
}
bool CMakeProjectNode::showInSimpleTree() const
{
return true;
}
QString CMakeProjectNode::tooltip() const
{
return QString();
@@ -181,11 +171,6 @@ QString CMakeTargetNode::generateId(const Utils::FileName &directory, const QStr
return directory.toString() + "///::///" + target;
}
bool CMakeTargetNode::showInSimpleTree() const
{
return true;
}
QString CMakeTargetNode::tooltip() const
{
return m_tooltip;

View File

@@ -34,8 +34,6 @@ class CMakeInputsNode : public ProjectExplorer::ProjectNode
{
public:
CMakeInputsNode(const Utils::FileName &cmakeLists);
bool showInSimpleTree() const final;
};
class CMakeListsNode : public ProjectExplorer::ProjectNode
@@ -53,7 +51,6 @@ class CMakeProjectNode : public ProjectExplorer::ProjectNode
public:
CMakeProjectNode(const Utils::FileName &directory);
bool showInSimpleTree() const final;
QString tooltip() const final;
bool addFiles(const QStringList &filePaths, QStringList *notAdded) override;
@@ -68,7 +65,6 @@ public:
void setTargetInformation(const QList<Utils::FileName> &artifacts, const QString &type);
bool showInSimpleTree() const final;
QString tooltip() const final;
QString buildKey() const final;

View File

@@ -129,8 +129,6 @@ public:
setDisplayName(project->projectFilePath().toFileInfo().completeBaseName());
}
bool showInSimpleTree() const override { return true; }
bool supportsAction(ProjectAction action, const Node *) const override
{
return action == AddNewFile

View File

@@ -337,6 +337,7 @@ public:
bool isFolderNodeType() const override { return false; }
bool isProjectNodeType() const override { return true; }
bool showInSimpleTree() const override { return true; }
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;

View File

@@ -115,7 +115,6 @@ class PythonProjectNode : public ProjectNode
public:
PythonProjectNode(PythonProject *project);
bool showInSimpleTree() const override;
bool supportsAction(ProjectAction action, const Node *node) const override;
bool addFiles(const QStringList &filePaths, QStringList *) override;
bool removeFiles(const QStringList &filePaths, QStringList *) override;
@@ -611,11 +610,6 @@ QHash<QString, QStringList> sortFilesIntoPaths(const QString &base, const QSet<Q
return filesInPath;
}
bool PythonProjectNode::showInSimpleTree() const
{
return true;
}
bool PythonProjectNode::supportsAction(ProjectAction action, const Node *node) const
{
if (node->asFileNode()) {

View File

@@ -330,11 +330,6 @@ QbsProductNode::QbsProductNode(const qbs::ProductData &prd) :
setIcon(productIcon);
}
bool QbsProductNode::showInSimpleTree() const
{
return true;
}
bool QbsProductNode::supportsAction(ProjectAction action, const Node *node) const
{
if (action == AddNewFile || action == AddExistingFile)
@@ -425,11 +420,6 @@ const qbs::Project QbsProjectNode::qbsProject() const
return project()->qbsProject();
}
bool QbsProjectNode::showInSimpleTree() const
{
return true;
}
void QbsProjectNode::setProjectData(const qbs::ProjectData &data)
{
m_projectData = data;

View File

@@ -44,6 +44,7 @@ class QbsGroupNode : public ProjectExplorer::ProjectNode
public:
QbsGroupNode(const qbs::GroupData &grp, const QString &productPath);
bool showInSimpleTree() const final { return false; }
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
@@ -65,7 +66,6 @@ class QbsProductNode : public ProjectExplorer::ProjectNode
public:
explicit QbsProductNode(const qbs::ProductData &prd);
bool showInSimpleTree() const override;
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
@@ -93,7 +93,6 @@ public:
const qbs::Project qbsProject() const;
const qbs::ProjectData qbsProjectData() const { return m_projectData; }
bool showInSimpleTree() const override;
void setProjectData(const qbs::ProjectData &data); // FIXME: Needed?
private:

View File

@@ -53,11 +53,6 @@ QmlProjectNode::QmlProjectNode(QmlProject *project) : ProjectNode(project->proje
setIcon(qmlProjectIcon);
}
bool QmlProjectNode::showInSimpleTree() const
{
return true;
}
bool QmlProjectNode::supportsAction(ProjectAction action, const Node *node) const
{
if (action == AddNewFile || action == EraseFile)

View File

@@ -38,7 +38,6 @@ class QmlProjectNode : public ProjectExplorer::ProjectNode
public:
QmlProjectNode(QmlProject *project);
bool showInSimpleTree() const override;
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const override;
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
bool deleteFiles(const QStringList &filePaths) override;