forked from qt-creator/qt-creator
Meson: De-noise
Change-Id: I7ef49cbb29fc5429972abc24e9db5dbca506da0d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -10,38 +10,40 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
MesonProjectNode::MesonProjectNode(const Utils::FilePath &directory)
|
||||
: ProjectExplorer::ProjectNode{directory}
|
||||
namespace MesonProjectManager::Internal {
|
||||
|
||||
MesonProjectNode::MesonProjectNode(const FilePath &directory)
|
||||
: ProjectNode(directory)
|
||||
{
|
||||
setPriority(Node::DefaultProjectPriority + 1000);
|
||||
setIcon(Constants::Icons::MESON);
|
||||
setListInProject(false);
|
||||
}
|
||||
|
||||
MesonFileNode::MesonFileNode(const Utils::FilePath &file)
|
||||
: ProjectExplorer::ProjectNode{file}
|
||||
MesonFileNode::MesonFileNode(const FilePath &file)
|
||||
: ProjectNode(file)
|
||||
{
|
||||
setIcon(ProjectExplorer::DirectoryIcon(Constants::Icons::MESON));
|
||||
setIcon(DirectoryIcon(Constants::Icons::MESON));
|
||||
setListInProject(true);
|
||||
}
|
||||
|
||||
MesonTargetNode::MesonTargetNode(const Utils::FilePath &directory, const QString &name)
|
||||
: ProjectExplorer::ProjectNode{directory}
|
||||
, m_name{name}
|
||||
MesonTargetNode::MesonTargetNode(const FilePath &directory, const QString &name)
|
||||
: ProjectNode(directory)
|
||||
, m_name(name)
|
||||
{
|
||||
setPriority(Node::DefaultProjectPriority + 900);
|
||||
setIcon(":/projectexplorer/images/build.png");
|
||||
setListInProject(false);
|
||||
setShowWhenEmpty(true);
|
||||
setProductType(ProjectExplorer::ProductType::Other);
|
||||
setProductType(ProductType::Other);
|
||||
}
|
||||
|
||||
void MesonTargetNode::build()
|
||||
{
|
||||
ProjectExplorer::Project *p = getProject();
|
||||
Project *p = getProject();
|
||||
ProjectExplorer::Target *t = p ? p->activeTarget() : nullptr;
|
||||
if (t)
|
||||
static_cast<MesonBuildSystem *>(t->buildSystem())->mesonBuildConfiguration()->build(m_name);
|
||||
@@ -57,5 +59,4 @@ QString MesonTargetNode::buildKey() const
|
||||
return m_name;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace MesonProjectManager
|
||||
} // MesonProjectManager::Internal
|
||||
|
@@ -5,11 +5,7 @@
|
||||
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/fsengine/fileiconprovider.h>
|
||||
|
||||
namespace MesonProjectManager {
|
||||
namespace Internal {
|
||||
namespace MesonProjectManager::Internal {
|
||||
|
||||
class MesonProjectNode : public ProjectExplorer::ProjectNode
|
||||
{
|
||||
@@ -21,6 +17,7 @@ class MesonTargetNode : public ProjectExplorer::ProjectNode
|
||||
{
|
||||
public:
|
||||
MesonTargetNode(const Utils::FilePath &directory, const QString &name);
|
||||
|
||||
void build() override;
|
||||
QString tooltip() const final;
|
||||
QString buildKey() const final;
|
||||
@@ -33,6 +30,7 @@ class MesonFileNode : public ProjectExplorer::ProjectNode
|
||||
{
|
||||
public:
|
||||
MesonFileNode(const Utils::FilePath &file);
|
||||
|
||||
bool showInSimpleTree() const final { return false; }
|
||||
std::optional<Utils::FilePath> visibleAfterAddFileAction() const override
|
||||
{
|
||||
@@ -40,5 +38,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace MesonProjectManager
|
||||
} // MesonProjectManager:Internal
|
||||
|
Reference in New Issue
Block a user