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