forked from qt-creator/qt-creator
QbsProjectManager: Modernize
modernize-use-auto modernize-use-nullptr modernize-use-override Change-Id: I8a67b87e614f54554f9ca50c9f5e3f3297458ec1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -45,10 +45,10 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
|
|||||||
int currentRow = 0;
|
int currentRow = 0;
|
||||||
for (QVariantMap::ConstIterator it = properties.constBegin(); it != properties.constEnd();
|
for (QVariantMap::ConstIterator it = properties.constBegin(); it != properties.constEnd();
|
||||||
++it) {
|
++it) {
|
||||||
QTableWidgetItem * const nameItem = new QTableWidgetItem;
|
auto * const nameItem = new QTableWidgetItem;
|
||||||
nameItem->setData(Qt::DisplayRole, it.key());
|
nameItem->setData(Qt::DisplayRole, it.key());
|
||||||
m_ui->propertiesTable->setItem(currentRow, 0, nameItem);
|
m_ui->propertiesTable->setItem(currentRow, 0, nameItem);
|
||||||
QTableWidgetItem * const valueItem = new QTableWidgetItem;
|
auto * const valueItem = new QTableWidgetItem;
|
||||||
valueItem->setData(Qt::DisplayRole, qbs::settingsValueToRepresentation(it.value()));
|
valueItem->setData(Qt::DisplayRole, qbs::settingsValueToRepresentation(it.value()));
|
||||||
m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
|
m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
|
||||||
++currentRow;
|
++currentRow;
|
||||||
|
@@ -37,10 +37,10 @@ class CustomQbsPropertiesDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CustomQbsPropertiesDialog(const QVariantMap &properties, QWidget *parent = 0);
|
explicit CustomQbsPropertiesDialog(const QVariantMap &properties, QWidget *parent = nullptr);
|
||||||
|
|
||||||
QVariantMap properties() const;
|
QVariantMap properties() const;
|
||||||
~CustomQbsPropertiesDialog();
|
~CustomQbsPropertiesDialog() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addProperty();
|
void addProperty();
|
||||||
|
@@ -296,7 +296,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
|
|||||||
}
|
}
|
||||||
data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFileInfo.absolutePath());
|
data.insert(QLatin1String(CPP_TOOLCHAINPATH), mainFileInfo.absolutePath());
|
||||||
|
|
||||||
if (ProjectExplorer::GccToolChain *gcc = dynamic_cast<ProjectExplorer::GccToolChain *>(mainTc)) {
|
if (auto gcc = dynamic_cast<ProjectExplorer::GccToolChain *>(mainTc)) {
|
||||||
QStringList compilerFlags = gcc->platformCodeGenFlags();
|
QStringList compilerFlags = gcc->platformCodeGenFlags();
|
||||||
filterCompilerLinkerFlags(targetAbi, compilerFlags);
|
filterCompilerLinkerFlags(targetAbi, compilerFlags);
|
||||||
data.insert(QLatin1String(CPP_PLATFORMCOMMONCOMPILERFLAGS), compilerFlags);
|
data.insert(QLatin1String(CPP_PLATFORMCOMMONCOMPILERFLAGS), compilerFlags);
|
||||||
|
@@ -35,8 +35,9 @@ class DefaultPropertyProvider : public PropertyProvider
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool canHandle(const ProjectExplorer::Kit *k) const { return k; }
|
bool canHandle(const ProjectExplorer::Kit *k) const override { return k; }
|
||||||
QVariantMap properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const;
|
QVariantMap properties(const ProjectExplorer::Kit *k,
|
||||||
|
const QVariantMap &defaultData) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariantMap autoGeneratedProperties(const ProjectExplorer::Kit *k,
|
QVariantMap autoGeneratedProperties(const ProjectExplorer::Kit *k,
|
||||||
|
@@ -40,7 +40,7 @@ class QBSPROJECTMANAGER_EXPORT PropertyProvider : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
PropertyProvider();
|
PropertyProvider();
|
||||||
~PropertyProvider();
|
~PropertyProvider() override;
|
||||||
|
|
||||||
virtual bool canHandle(const ProjectExplorer::Kit *k) const = 0;
|
virtual bool canHandle(const ProjectExplorer::Kit *k) const = 0;
|
||||||
virtual QVariantMap properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const = 0;
|
virtual QVariantMap properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const = 0;
|
||||||
|
@@ -85,7 +85,7 @@ void QbsBuildConfiguration::initialize(const BuildInfo *info)
|
|||||||
{
|
{
|
||||||
BuildConfiguration::initialize(info);
|
BuildConfiguration::initialize(info);
|
||||||
|
|
||||||
const QbsBuildInfo * const bi = static_cast<const QbsBuildInfo *>(info);
|
const auto * const bi = static_cast<const QbsBuildInfo *>(info);
|
||||||
QVariantMap configData = bi->config;
|
QVariantMap configData = bi->config;
|
||||||
configData.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY),
|
configData.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY),
|
||||||
(info->buildType == BuildConfiguration::Debug)
|
(info->buildType == BuildConfiguration::Debug)
|
||||||
@@ -136,7 +136,7 @@ bool QbsBuildConfiguration::fromMap(const QVariantMap &map)
|
|||||||
BuildStepList *bsl = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
BuildStepList *bsl = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||||
// Fix up the existing build steps:
|
// Fix up the existing build steps:
|
||||||
for (int i = 0; i < bsl->count(); ++i) {
|
for (int i = 0; i < bsl->count(); ++i) {
|
||||||
QbsBuildStep *bs = qobject_cast<QbsBuildStep *>(bsl->at(i));
|
auto bs = qobject_cast<QbsBuildStep *>(bsl->at(i));
|
||||||
if (bs)
|
if (bs)
|
||||||
connect(bs, &QbsBuildStep::qbsConfigurationChanged, this, &QbsBuildConfiguration::qbsConfigurationChanged);
|
connect(bs, &QbsBuildStep::qbsConfigurationChanged, this, &QbsBuildConfiguration::qbsConfigurationChanged);
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ Internal::QbsProject *QbsBuildConfiguration::project() const
|
|||||||
IOutputParser *QbsBuildConfiguration::createOutputParser() const
|
IOutputParser *QbsBuildConfiguration::createOutputParser() const
|
||||||
{
|
{
|
||||||
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||||
return tc ? tc->outputParser() : 0;
|
return tc ? tc->outputParser() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QbsBuildConfiguration::isEnabled() const
|
bool QbsBuildConfiguration::isEnabled() const
|
||||||
|
@@ -49,16 +49,16 @@ QbsBuildConfigurationWidget::QbsBuildConfigurationWidget(QbsProjectManager::Inte
|
|||||||
connect(bc, &ProjectExplorer::BuildConfiguration::environmentChanged,
|
connect(bc, &ProjectExplorer::BuildConfiguration::environmentChanged,
|
||||||
this, &QbsBuildConfigurationWidget::environmentHasChanged);
|
this, &QbsBuildConfigurationWidget::environmentHasChanged);
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
auto vbox = new QVBoxLayout(this);
|
||||||
vbox->setMargin(0);
|
vbox->setMargin(0);
|
||||||
Utils::DetailsWidget *container = new Utils::DetailsWidget(this);
|
auto container = new Utils::DetailsWidget(this);
|
||||||
container->setState(Utils::DetailsWidget::NoSummary);
|
container->setState(Utils::DetailsWidget::NoSummary);
|
||||||
vbox->addWidget(container);
|
vbox->addWidget(container);
|
||||||
|
|
||||||
QWidget *details = new QWidget(container);
|
QWidget *details = new QWidget(container);
|
||||||
container->setWidget(details);
|
container->setWidget(details);
|
||||||
|
|
||||||
QGridLayout *layout = new QGridLayout(details);
|
auto layout = new QGridLayout(details);
|
||||||
layout->setMargin(0);
|
layout->setMargin(0);
|
||||||
layout->addWidget(new QLabel(tr("Build directory:")), 0, 0);
|
layout->addWidget(new QLabel(tr("Build directory:")), 0, 0);
|
||||||
|
|
||||||
|
@@ -67,9 +67,9 @@ class QbsBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QbsBuildStepConfigWidget(QbsBuildStep *step);
|
QbsBuildStepConfigWidget(QbsBuildStep *step);
|
||||||
~QbsBuildStepConfigWidget();
|
~QbsBuildStepConfigWidget() override;
|
||||||
QString summaryText() const;
|
QString summaryText() const override;
|
||||||
QString displayName() const;
|
QString displayName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateState();
|
void updateState();
|
||||||
@@ -137,7 +137,7 @@ QbsBuildStep::~QbsBuildStep()
|
|||||||
cancel();
|
cancel();
|
||||||
if (m_job) {
|
if (m_job) {
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = nullptr;
|
||||||
}
|
}
|
||||||
delete m_parser;
|
delete m_parser;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ bool QbsBuildStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
if (project()->isParsing() || m_job)
|
if (project()->isParsing() || m_job)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||||
|
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return false;
|
return false;
|
||||||
@@ -220,7 +220,7 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co
|
|||||||
|
|
||||||
void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
|
void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
|
||||||
{
|
{
|
||||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
auto pro = static_cast<QbsProject *>(project());
|
||||||
|
|
||||||
QVariantMap tmp = config;
|
QVariantMap tmp = config;
|
||||||
tmp.insert(Constants::QBS_CONFIG_PROFILE_KEY, pro->profileForTarget(target()));
|
tmp.insert(Constants::QBS_CONFIG_PROFILE_KEY, pro->profileForTarget(target()));
|
||||||
@@ -231,7 +231,7 @@ void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
|
|||||||
if (tmp == m_qbsConfiguration)
|
if (tmp == m_qbsConfiguration)
|
||||||
return;
|
return;
|
||||||
m_qbsConfiguration = tmp;
|
m_qbsConfiguration = tmp;
|
||||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||||
if (bc)
|
if (bc)
|
||||||
bc->emitBuildTypeChanged();
|
bc->emitBuildTypeChanged();
|
||||||
emit qbsConfigurationChanged();
|
emit qbsConfigurationChanged();
|
||||||
@@ -330,7 +330,7 @@ void QbsBuildStep::buildingDone(bool success)
|
|||||||
createTaskAndOutput(ProjectExplorer::Task::Error, item.description(),
|
createTaskAndOutput(ProjectExplorer::Task::Error, item.description(),
|
||||||
item.codeLocation().filePath(), item.codeLocation().line());
|
item.codeLocation().filePath(), item.codeLocation().line());
|
||||||
|
|
||||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
auto pro = static_cast<QbsProject *>(project());
|
||||||
|
|
||||||
// Building can uncover additional target artifacts.
|
// Building can uncover additional target artifacts.
|
||||||
pro->updateAfterBuild();
|
pro->updateAfterBuild();
|
||||||
@@ -424,7 +424,7 @@ void QbsBuildStep::setBuildVariant(const QString &variant)
|
|||||||
return;
|
return;
|
||||||
m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant);
|
m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant);
|
||||||
emit qbsConfigurationChanged();
|
emit qbsConfigurationChanged();
|
||||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||||
if (bc)
|
if (bc)
|
||||||
bc->emitBuildTypeChanged();
|
bc->emitBuildTypeChanged();
|
||||||
}
|
}
|
||||||
@@ -517,10 +517,10 @@ void QbsBuildStep::finish()
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(m_fi, return);
|
QTC_ASSERT(m_fi, return);
|
||||||
reportRunResult(*m_fi, m_lastWasSuccess);
|
reportRunResult(*m_fi, m_lastWasSuccess);
|
||||||
m_fi = 0; // do not delete, it is not ours
|
m_fi = nullptr; // do not delete, it is not ours
|
||||||
if (m_job) {
|
if (m_job) {
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ QbsCleanStep::~QbsCleanStep()
|
|||||||
cancel();
|
cancel();
|
||||||
if (m_job) {
|
if (m_job) {
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ bool QbsCleanStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
if (project()->isParsing() || m_job)
|
if (project()->isParsing() || m_job)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
auto bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
|
||||||
|
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return false;
|
return false;
|
||||||
@@ -82,7 +82,7 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
|
|||||||
{
|
{
|
||||||
m_fi = &fi;
|
m_fi = &fi;
|
||||||
|
|
||||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
auto pro = static_cast<QbsProject *>(project());
|
||||||
qbs::CleanOptions options(m_qbsCleanOptions);
|
qbs::CleanOptions options(m_qbsCleanOptions);
|
||||||
|
|
||||||
QString error;
|
QString error;
|
||||||
@@ -164,9 +164,9 @@ void QbsCleanStep::cleaningDone(bool success)
|
|||||||
|
|
||||||
QTC_ASSERT(m_fi, return);
|
QTC_ASSERT(m_fi, return);
|
||||||
reportRunResult(*m_fi, success);
|
reportRunResult(*m_fi, success);
|
||||||
m_fi = 0; // do not delete, it is not ours
|
m_fi = nullptr; // do not delete, it is not ours
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsCleanStep::handleTaskStarted(const QString &desciption, int max)
|
void QbsCleanStep::handleTaskStarted(const QString &desciption, int max)
|
||||||
|
@@ -95,9 +95,9 @@ class QbsCleanStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QbsCleanStepConfigWidget(QbsCleanStep *step);
|
QbsCleanStepConfigWidget(QbsCleanStep *step);
|
||||||
~QbsCleanStepConfigWidget();
|
~QbsCleanStepConfigWidget() override;
|
||||||
QString summaryText() const;
|
QString summaryText() const override;
|
||||||
QString displayName() const;
|
QString displayName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateState();
|
void updateState();
|
||||||
|
@@ -76,7 +76,7 @@ QbsInstallStep::~QbsInstallStep()
|
|||||||
cancel();
|
cancel();
|
||||||
if (m_job)
|
if (m_job)
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QbsInstallStep::init(QList<const BuildStep *> &earlierSteps)
|
bool QbsInstallStep::init(QList<const BuildStep *> &earlierSteps)
|
||||||
@@ -90,7 +90,7 @@ void QbsInstallStep::run(QFutureInterface<bool> &fi)
|
|||||||
{
|
{
|
||||||
m_fi = &fi;
|
m_fi = &fi;
|
||||||
|
|
||||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
auto pro = static_cast<QbsProject *>(project());
|
||||||
m_job = pro->install(m_qbsInstallOptions);
|
m_job = pro->install(m_qbsInstallOptions);
|
||||||
|
|
||||||
if (!m_job) {
|
if (!m_job) {
|
||||||
@@ -187,9 +187,9 @@ void QbsInstallStep::installDone(bool success)
|
|||||||
|
|
||||||
QTC_ASSERT(m_fi, return);
|
QTC_ASSERT(m_fi, return);
|
||||||
reportRunResult(*m_fi, success);
|
reportRunResult(*m_fi, success);
|
||||||
m_fi = 0; // do not delete, it is not ours
|
m_fi = nullptr; // do not delete, it is not ours
|
||||||
m_job->deleteLater();
|
m_job->deleteLater();
|
||||||
m_job = 0;
|
m_job = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsInstallStep::handleTaskStarted(const QString &desciption, int max)
|
void QbsInstallStep::handleTaskStarted(const QString &desciption, int max)
|
||||||
@@ -260,7 +260,7 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
|
|||||||
|
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
QbsProject *project = static_cast<QbsProject *>(m_step->project());
|
auto project = static_cast<QbsProject *>(m_step->project());
|
||||||
|
|
||||||
m_ui = new Ui::QbsInstallStepConfigWidget;
|
m_ui = new Ui::QbsInstallStepConfigWidget;
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
@@ -98,9 +98,9 @@ class QbsInstallStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QbsInstallStepConfigWidget(QbsInstallStep *step);
|
QbsInstallStepConfigWidget(QbsInstallStep *step);
|
||||||
~QbsInstallStepConfigWidget();
|
~QbsInstallStepConfigWidget() override;
|
||||||
QString summaryText() const;
|
QString summaryText() const override;
|
||||||
QString displayName() const;
|
QString displayName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateState();
|
void updateState();
|
||||||
|
@@ -40,7 +40,7 @@ class QbsLogSink : public QObject, public qbs::ILogSink
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QbsLogSink(QObject *parent = 0);
|
QbsLogSink(QObject *parent = nullptr);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void newTask(const ProjectExplorer::Task &task);
|
void newTask(const ProjectExplorer::Task &task);
|
||||||
@@ -48,8 +48,9 @@ signals:
|
|||||||
private:
|
private:
|
||||||
Q_INVOKABLE void sendMessages();
|
Q_INVOKABLE void sendMessages();
|
||||||
|
|
||||||
void doPrintWarning(const qbs::ErrorInfo &warning);
|
void doPrintWarning(const qbs::ErrorInfo &warning) override;
|
||||||
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);
|
void doPrintMessage(qbs::LoggerLevel level, const QString &message,
|
||||||
|
const QString &tag) override;
|
||||||
|
|
||||||
QStringList m_messages;
|
QStringList m_messages;
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
|
@@ -56,21 +56,21 @@ namespace Internal {
|
|||||||
static const QbsProjectNode *parentQbsProjectNode(const ProjectExplorer::Node *node)
|
static const QbsProjectNode *parentQbsProjectNode(const ProjectExplorer::Node *node)
|
||||||
{
|
{
|
||||||
for (const ProjectExplorer::FolderNode *pn = node->managingProject(); pn; pn = pn->parentProjectNode()) {
|
for (const ProjectExplorer::FolderNode *pn = node->managingProject(); pn; pn = pn->parentProjectNode()) {
|
||||||
const QbsProjectNode *prjNode = dynamic_cast<const QbsProjectNode *>(pn);
|
const auto prjNode = dynamic_cast<const QbsProjectNode *>(pn);
|
||||||
if (prjNode)
|
if (prjNode)
|
||||||
return prjNode;
|
return prjNode;
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const QbsProductNode *parentQbsProductNode(const ProjectExplorer::Node *node)
|
static const QbsProductNode *parentQbsProductNode(const ProjectExplorer::Node *node)
|
||||||
{
|
{
|
||||||
for (; node; node = node->parentFolderNode()) {
|
for (; node; node = node->parentFolderNode()) {
|
||||||
const QbsProductNode *prdNode = dynamic_cast<const QbsProductNode *>(node);
|
const auto prdNode = dynamic_cast<const QbsProductNode *>(node);
|
||||||
if (prdNode)
|
if (prdNode)
|
||||||
return prdNode;
|
return prdNode;
|
||||||
}
|
}
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static qbs::GroupData findMainQbsGroup(const qbs::ProductData &productData)
|
static qbs::GroupData findMainQbsGroup(const qbs::ProductData &productData)
|
||||||
@@ -84,7 +84,7 @@ static qbs::GroupData findMainQbsGroup(const qbs::ProductData &productData)
|
|||||||
|
|
||||||
class FileTreeNode {
|
class FileTreeNode {
|
||||||
public:
|
public:
|
||||||
explicit FileTreeNode(const QString &n = QString(), FileTreeNode *p = 0, bool f = false) :
|
explicit FileTreeNode(const QString &n = QString(), FileTreeNode *p = nullptr, bool f = false) :
|
||||||
parent(p), name(n), m_isFile(f)
|
parent(p), name(n), m_isFile(f)
|
||||||
{
|
{
|
||||||
if (p)
|
if (p)
|
||||||
@@ -109,14 +109,14 @@ public:
|
|||||||
|
|
||||||
static FileTreeNode *moveChildrenUp(FileTreeNode *node)
|
static FileTreeNode *moveChildrenUp(FileTreeNode *node)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(node, return 0);
|
QTC_ASSERT(node, return nullptr);
|
||||||
|
|
||||||
FileTreeNode *newParent = node->parent;
|
FileTreeNode *newParent = node->parent;
|
||||||
if (!newParent)
|
if (!newParent)
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
// disconnect node and parent:
|
// disconnect node and parent:
|
||||||
node->parent = 0;
|
node->parent = nullptr;
|
||||||
newParent->children.removeOne(node);
|
newParent->children.removeOne(node);
|
||||||
|
|
||||||
foreach (FileTreeNode *c, node->children) {
|
foreach (FileTreeNode *c, node->children) {
|
||||||
@@ -163,7 +163,7 @@ public:
|
|||||||
// Clean up node:
|
// Clean up node:
|
||||||
node->children.clear();
|
node->children.clear();
|
||||||
node->parent->children.removeOne(node);
|
node->parent->children.removeOne(node);
|
||||||
node->parent = 0;
|
node->parent = nullptr;
|
||||||
delete node;
|
delete node;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -184,7 +184,7 @@ public:
|
|||||||
if (node->children.isEmpty() && !node->isFile()) {
|
if (node->children.isEmpty() && !node->isFile()) {
|
||||||
// Clean up empty folder nodes:
|
// Clean up empty folder nodes:
|
||||||
node->parent->children.removeOne(node);
|
node->parent->children.removeOne(node);
|
||||||
node->parent = 0;
|
node->parent = nullptr;
|
||||||
delete node;
|
delete node;
|
||||||
} else if (node->children.count() == 1 && !node->children.at(0)->isFile()) {
|
} else if (node->children.count() == 1 && !node->children.at(0)->isFile()) {
|
||||||
// Compact folder nodes with one child only:
|
// Compact folder nodes with one child only:
|
||||||
|
@@ -82,8 +82,8 @@ public:
|
|||||||
QbsGroupNode(const qbs::GroupData &grp, const QString &productPath);
|
QbsGroupNode(const qbs::GroupData &grp, const QString &productPath);
|
||||||
|
|
||||||
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
|
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
|
||||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||||
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
||||||
|
|
||||||
qbs::GroupData qbsGroupData() const { return m_qbsGroupData; }
|
qbs::GroupData qbsGroupData() const { return m_qbsGroupData; }
|
||||||
@@ -106,8 +106,8 @@ public:
|
|||||||
|
|
||||||
bool showInSimpleTree() const override;
|
bool showInSimpleTree() const override;
|
||||||
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
|
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const final;
|
||||||
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
||||||
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
||||||
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
||||||
|
|
||||||
const qbs::ProductData qbsProductData() const { return m_qbsProductData; }
|
const qbs::ProductData qbsProductData() const { return m_qbsProductData; }
|
||||||
|
@@ -42,8 +42,8 @@ public:
|
|||||||
explicit QbsParser();
|
explicit QbsParser();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setWorkingDirectory(const QString &workingDirectory);
|
void setWorkingDirectory(const QString &workingDirectory) override;
|
||||||
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
|
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines) override;
|
||||||
|
|
||||||
QDir m_workingDirectory;
|
QDir m_workingDirectory;
|
||||||
};
|
};
|
||||||
|
@@ -52,7 +52,7 @@ class QbsProfilesSettingsWidget : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QbsProfilesSettingsWidget(QWidget *parent = 0);
|
QbsProfilesSettingsWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void apply();
|
void apply();
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ private:
|
|||||||
|
|
||||||
QbsProfilesSettingsPage::QbsProfilesSettingsPage(QObject *parent)
|
QbsProfilesSettingsPage::QbsProfilesSettingsPage(QObject *parent)
|
||||||
: Core::IOptionsPage(parent)
|
: Core::IOptionsPage(parent)
|
||||||
, m_widget(0)
|
, m_widget(nullptr)
|
||||||
, m_useQtcSettingsDirPersistent(QbsProjectManagerSettings::useCreatorSettingsDirForQbs())
|
, m_useQtcSettingsDirPersistent(QbsProjectManagerSettings::useCreatorSettingsDirForQbs())
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ void QbsProfilesSettingsPage::apply()
|
|||||||
void QbsProfilesSettingsPage::finish()
|
void QbsProfilesSettingsPage::finish()
|
||||||
{
|
{
|
||||||
delete m_widget;
|
delete m_widget;
|
||||||
m_widget = 0;
|
m_widget = nullptr;
|
||||||
QbsProjectManagerSettings::setUseCreatorSettingsDirForQbs(m_useQtcSettingsDirPersistent);
|
QbsProjectManagerSettings::setUseCreatorSettingsDirForQbs(m_useQtcSettingsDirPersistent);
|
||||||
QbsProjectManagerSettings::writeSettings();
|
QbsProjectManagerSettings::writeSettings();
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ void QbsProfilesSettingsWidget::apply()
|
|||||||
void QbsProfilesSettingsWidget::refreshKitsList()
|
void QbsProfilesSettingsWidget::refreshKitsList()
|
||||||
{
|
{
|
||||||
m_ui.kitsComboBox->disconnect(this);
|
m_ui.kitsComboBox->disconnect(this);
|
||||||
m_ui.propertiesView->setModel(0);
|
m_ui.propertiesView->setModel(nullptr);
|
||||||
m_model.reload();
|
m_model.reload();
|
||||||
m_ui.profileValueLabel->clear();
|
m_ui.profileValueLabel->clear();
|
||||||
Core::Id currentId;
|
Core::Id currentId;
|
||||||
@@ -159,7 +159,7 @@ void QbsProfilesSettingsWidget::refreshKitsList()
|
|||||||
|
|
||||||
void QbsProfilesSettingsWidget::displayCurrentProfile()
|
void QbsProfilesSettingsWidget::displayCurrentProfile()
|
||||||
{
|
{
|
||||||
m_ui.propertiesView->setModel(0);
|
m_ui.propertiesView->setModel(nullptr);
|
||||||
if (m_ui.kitsComboBox->currentIndex() == -1)
|
if (m_ui.kitsComboBox->currentIndex() == -1)
|
||||||
return;
|
return;
|
||||||
const Core::Id kitId = Core::Id::fromSetting(m_ui.kitsComboBox->currentData());
|
const Core::Id kitId = Core::Id::fromSetting(m_ui.kitsComboBox->currentData());
|
||||||
|
@@ -34,7 +34,7 @@ class QbsProfilesSettingsWidget;
|
|||||||
class QbsProfilesSettingsPage : public Core::IOptionsPage
|
class QbsProfilesSettingsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QbsProfilesSettingsPage(QObject *parent = 0);
|
QbsProfilesSettingsPage(QObject *parent = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *widget() override;
|
QWidget *widget() override;
|
||||||
|
@@ -121,8 +121,8 @@ private:
|
|||||||
|
|
||||||
QbsProject::QbsProject(const FileName &fileName) :
|
QbsProject::QbsProject(const FileName &fileName) :
|
||||||
Project(Constants::MIME_TYPE, fileName, [this]() { delayParsing(); }),
|
Project(Constants::MIME_TYPE, fileName, [this]() { delayParsing(); }),
|
||||||
m_qbsProjectParser(0),
|
m_qbsProjectParser(nullptr),
|
||||||
m_qbsUpdateFutureInterface(0),
|
m_qbsUpdateFutureInterface(nullptr),
|
||||||
m_parsingScheduled(false),
|
m_parsingScheduled(false),
|
||||||
m_cancelStatus(CancelStatusNone),
|
m_cancelStatus(CancelStatusNone),
|
||||||
m_cppCodeModelUpdater(new CppTools::CppProjectUpdater(this)),
|
m_cppCodeModelUpdater(new CppTools::CppProjectUpdater(this)),
|
||||||
@@ -174,7 +174,7 @@ QbsProject::~QbsProject()
|
|||||||
m_qbsUpdateFutureInterface->reportCanceled();
|
m_qbsUpdateFutureInterface->reportCanceled();
|
||||||
m_qbsUpdateFutureInterface->reportFinished();
|
m_qbsUpdateFutureInterface->reportFinished();
|
||||||
delete m_qbsUpdateFutureInterface;
|
delete m_qbsUpdateFutureInterface;
|
||||||
m_qbsUpdateFutureInterface = 0;
|
m_qbsUpdateFutureInterface = nullptr;
|
||||||
}
|
}
|
||||||
qDeleteAll(m_extraCompilers);
|
qDeleteAll(m_extraCompilers);
|
||||||
std::for_each(m_qbsDocuments.cbegin(), m_qbsDocuments.cend(),
|
std::for_each(m_qbsDocuments.cbegin(), m_qbsDocuments.cend(),
|
||||||
@@ -210,7 +210,7 @@ class ChangeExpector
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChangeExpector(const QString &filePath, const QSet<IDocument *> &documents)
|
ChangeExpector(const QString &filePath, const QSet<IDocument *> &documents)
|
||||||
: m_document(0)
|
: m_document(nullptr)
|
||||||
{
|
{
|
||||||
foreach (IDocument * const doc, documents) {
|
foreach (IDocument * const doc, documents) {
|
||||||
if (doc->filePath().toString() == filePath) {
|
if (doc->filePath().toString() == filePath) {
|
||||||
@@ -362,8 +362,8 @@ template<typename Options>
|
|||||||
qbs::AbstractJob *QbsProject::buildOrClean(const Options &opts, const QStringList &productNames,
|
qbs::AbstractJob *QbsProject::buildOrClean(const Options &opts, const QStringList &productNames,
|
||||||
QString &error)
|
QString &error)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(qbsProject().isValid(), return 0);
|
QTC_ASSERT(qbsProject().isValid(), return nullptr);
|
||||||
QTC_ASSERT(!isParsing(), return 0);
|
QTC_ASSERT(!isParsing(), return nullptr);
|
||||||
|
|
||||||
QList<qbs::ProductData> products;
|
QList<qbs::ProductData> products;
|
||||||
foreach (const QString &productName, productNames) {
|
foreach (const QString &productName, productNames) {
|
||||||
@@ -400,7 +400,7 @@ qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts, const QStringLis
|
|||||||
qbs::InstallJob *QbsProject::install(const qbs::InstallOptions &opts)
|
qbs::InstallJob *QbsProject::install(const qbs::InstallOptions &opts)
|
||||||
{
|
{
|
||||||
if (!qbsProject().isValid())
|
if (!qbsProject().isValid())
|
||||||
return 0;
|
return nullptr;
|
||||||
return qbsProject().installAllProducts(opts);
|
return qbsProject().installAllProducts(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ bool QbsProject::checkCancelStatus()
|
|||||||
return false;
|
return false;
|
||||||
qCDebug(qbsPmLog) << "Cancel request while parsing, starting re-parse";
|
qCDebug(qbsPmLog) << "Cancel request while parsing, starting re-parse";
|
||||||
m_qbsProjectParser->deleteLater();
|
m_qbsProjectParser->deleteLater();
|
||||||
m_qbsProjectParser = 0;
|
m_qbsProjectParser = nullptr;
|
||||||
emitParsingFinished(false);
|
emitParsingFinished(false);
|
||||||
parseCurrentBuildConfiguration();
|
parseCurrentBuildConfiguration();
|
||||||
return true;
|
return true;
|
||||||
@@ -514,10 +514,10 @@ void QbsProject::handleQbsParsingDone(bool success)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_qbsProjectParser->deleteLater();
|
m_qbsProjectParser->deleteLater();
|
||||||
m_qbsProjectParser = 0;
|
m_qbsProjectParser = nullptr;
|
||||||
m_qbsUpdateFutureInterface->reportFinished();
|
m_qbsUpdateFutureInterface->reportFinished();
|
||||||
delete m_qbsUpdateFutureInterface;
|
delete m_qbsUpdateFutureInterface;
|
||||||
m_qbsUpdateFutureInterface = 0;
|
m_qbsUpdateFutureInterface = nullptr;
|
||||||
|
|
||||||
if (dataChanged)
|
if (dataChanged)
|
||||||
updateAfterParse();
|
updateAfterParse();
|
||||||
@@ -539,10 +539,10 @@ void QbsProject::handleRuleExecutionDone()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_qbsProjectParser->deleteLater();
|
m_qbsProjectParser->deleteLater();
|
||||||
m_qbsProjectParser = 0;
|
m_qbsProjectParser = nullptr;
|
||||||
m_qbsUpdateFutureInterface->reportFinished();
|
m_qbsUpdateFutureInterface->reportFinished();
|
||||||
delete m_qbsUpdateFutureInterface;
|
delete m_qbsUpdateFutureInterface;
|
||||||
m_qbsUpdateFutureInterface = 0;
|
m_qbsUpdateFutureInterface = nullptr;
|
||||||
|
|
||||||
QTC_ASSERT(m_qbsProject.isValid(), return);
|
QTC_ASSERT(m_qbsProject.isValid(), return);
|
||||||
m_projectData = m_qbsProject.projectData();
|
m_projectData = m_qbsProject.projectData();
|
||||||
@@ -588,7 +588,7 @@ void QbsProject::parseCurrentBuildConfiguration()
|
|||||||
|
|
||||||
if (!activeTarget())
|
if (!activeTarget())
|
||||||
return;
|
return;
|
||||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
|
auto bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -719,7 +719,7 @@ void QbsProject::prepareForParsing()
|
|||||||
m_qbsUpdateFutureInterface->reportFinished();
|
m_qbsUpdateFutureInterface->reportFinished();
|
||||||
}
|
}
|
||||||
delete m_qbsUpdateFutureInterface;
|
delete m_qbsUpdateFutureInterface;
|
||||||
m_qbsUpdateFutureInterface = 0;
|
m_qbsUpdateFutureInterface = nullptr;
|
||||||
|
|
||||||
m_qbsUpdateFutureInterface = new QFutureInterface<bool>();
|
m_qbsUpdateFutureInterface = new QFutureInterface<bool>();
|
||||||
m_qbsUpdateFutureInterface->setProgressRange(0, 0);
|
m_qbsUpdateFutureInterface->setProgressRange(0, 0);
|
||||||
|
@@ -231,7 +231,7 @@ QList<BuildInfo *> QbsProjectImporter::buildInfoListForKit(const Kit *k, void *d
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
const auto * const bgData = static_cast<BuildGraphData *>(directoryData);
|
const auto * const bgData = static_cast<BuildGraphData *>(directoryData);
|
||||||
QbsBuildInfo * const buildInfo = new QbsBuildInfo(factory);
|
auto * const buildInfo = new QbsBuildInfo(factory);
|
||||||
buildInfo->displayName = bgData->bgFilePath.toFileInfo().completeBaseName();
|
buildInfo->displayName = bgData->bgFilePath.toFileInfo().completeBaseName();
|
||||||
buildInfo->buildType = bgData->buildVariant == "debug"
|
buildInfo->buildType = bgData->buildVariant == "debug"
|
||||||
? BuildConfiguration::Debug : BuildConfiguration::Release;
|
? BuildConfiguration::Debug : BuildConfiguration::Release;
|
||||||
|
@@ -46,7 +46,7 @@ class QbsManager : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
QbsManager();
|
QbsManager();
|
||||||
~QbsManager();
|
~QbsManager() override;
|
||||||
|
|
||||||
// QBS profiles management:
|
// QBS profiles management:
|
||||||
static QString profileForKit(const ProjectExplorer::Kit *k);
|
static QString profileForKit(const ProjectExplorer::Kit *k);
|
||||||
|
@@ -301,7 +301,7 @@ void QbsProjectManagerPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
void QbsProjectManagerPlugin::projectWasAdded(Project *project)
|
void QbsProjectManagerPlugin::projectWasAdded(Project *project)
|
||||||
{
|
{
|
||||||
QbsProject *qbsProject = qobject_cast<QbsProject *>(project);
|
auto qbsProject = qobject_cast<QbsProject *>(project);
|
||||||
|
|
||||||
if (!qbsProject)
|
if (!qbsProject)
|
||||||
return;
|
return;
|
||||||
@@ -314,7 +314,7 @@ void QbsProjectManagerPlugin::projectWasAdded(Project *project)
|
|||||||
|
|
||||||
void QbsProjectManagerPlugin::updateContextActions()
|
void QbsProjectManagerPlugin::updateContextActions()
|
||||||
{
|
{
|
||||||
QbsProject *project = qobject_cast<Internal::QbsProject *>(ProjectTree::currentProject());
|
auto project = qobject_cast<Internal::QbsProject *>(ProjectTree::currentProject());
|
||||||
const Node *node = ProjectTree::findCurrentNode();
|
const Node *node = ProjectTree::findCurrentNode();
|
||||||
bool isEnabled = !BuildManager::isBuilding(project)
|
bool isEnabled = !BuildManager::isBuilding(project)
|
||||||
&& project && !project->isParsing()
|
&& project && !project->isParsing()
|
||||||
@@ -322,7 +322,7 @@ void QbsProjectManagerPlugin::updateContextActions()
|
|||||||
|
|
||||||
bool isFile = project && node && (node->nodeType() == NodeType::File);
|
bool isFile = project && node && (node->nodeType() == NodeType::File);
|
||||||
const bool isProduct = project && node && dynamic_cast<const QbsProductNode *>(node);
|
const bool isProduct = project && node && dynamic_cast<const QbsProductNode *>(node);
|
||||||
const QbsProjectNode *subproject = dynamic_cast<const QbsProjectNode *>(node);
|
const auto subproject = dynamic_cast<const QbsProjectNode *>(node);
|
||||||
bool isSubproject = project && subproject && subproject != project->rootProjectNode();
|
bool isSubproject = project && subproject && subproject != project->rootProjectNode();
|
||||||
|
|
||||||
m_reparseQbsCtx->setEnabled(isEnabled);
|
m_reparseQbsCtx->setEnabled(isEnabled);
|
||||||
@@ -337,7 +337,7 @@ void QbsProjectManagerPlugin::updateContextActions()
|
|||||||
|
|
||||||
void QbsProjectManagerPlugin::updateReparseQbsAction()
|
void QbsProjectManagerPlugin::updateReparseQbsAction()
|
||||||
{
|
{
|
||||||
QbsProject *project = qobject_cast<QbsProject *>(SessionManager::startupProject());
|
auto project = qobject_cast<QbsProject *>(SessionManager::startupProject());
|
||||||
m_reparseQbs->setEnabled(project
|
m_reparseQbs->setEnabled(project
|
||||||
&& !BuildManager::isBuilding(project)
|
&& !BuildManager::isBuilding(project)
|
||||||
&& !project->isParsing());
|
&& !project->isParsing());
|
||||||
@@ -363,14 +363,14 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
|||||||
fileName = editorNode->filePath().fileName();
|
fileName = editorNode->filePath().fileName();
|
||||||
fileVisible = editorProject && editorNode && dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
fileVisible = editorProject && editorNode && dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
||||||
|
|
||||||
QbsProductNode *productNode =
|
auto productNode =
|
||||||
dynamic_cast<QbsProductNode *>(editorNode ? editorNode->parentProjectNode() : 0);
|
dynamic_cast<QbsProductNode *>(editorNode ? editorNode->parentProjectNode() : nullptr);
|
||||||
if (productNode) {
|
if (productNode) {
|
||||||
productVisible = true;
|
productVisible = true;
|
||||||
productName = productNode->displayName();
|
productName = productNode->displayName();
|
||||||
}
|
}
|
||||||
QbsProjectNode *subprojectNode =
|
auto subprojectNode =
|
||||||
dynamic_cast<QbsProjectNode *>(productNode ? productNode->parentFolderNode() : 0);
|
dynamic_cast<QbsProjectNode *>(productNode ? productNode->parentFolderNode() : nullptr);
|
||||||
if (subprojectNode && editorProject && subprojectNode != editorProject->rootProjectNode()) {
|
if (subprojectNode && editorProject && subprojectNode != editorProject->rootProjectNode()) {
|
||||||
subprojectVisible = true;
|
subprojectVisible = true;
|
||||||
subprojectName = subprojectNode->displayName();
|
subprojectName = subprojectNode->displayName();
|
||||||
@@ -404,7 +404,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
|||||||
|
|
||||||
void QbsProjectManagerPlugin::projectChanged()
|
void QbsProjectManagerPlugin::projectChanged()
|
||||||
{
|
{
|
||||||
QbsProject *project = qobject_cast<QbsProject *>(sender());
|
auto project = qobject_cast<QbsProject *>(sender());
|
||||||
|
|
||||||
if (!project || project == SessionManager::startupProject())
|
if (!project || project == SessionManager::startupProject())
|
||||||
updateReparseQbsAction();
|
updateReparseQbsAction();
|
||||||
@@ -420,7 +420,7 @@ void QbsProjectManagerPlugin::buildFileContextMenu()
|
|||||||
{
|
{
|
||||||
const Node *node = ProjectTree::findCurrentNode();
|
const Node *node = ProjectTree::findCurrentNode();
|
||||||
QTC_ASSERT(node, return);
|
QTC_ASSERT(node, return);
|
||||||
QbsProject *project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
buildSingleFile(project, node->filePath().toString());
|
buildSingleFile(project, node->filePath().toString());
|
||||||
}
|
}
|
||||||
@@ -457,10 +457,10 @@ void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Core::Id
|
|||||||
{
|
{
|
||||||
const Node *node = ProjectTree::findCurrentNode();
|
const Node *node = ProjectTree::findCurrentNode();
|
||||||
QTC_ASSERT(node, return);
|
QTC_ASSERT(node, return);
|
||||||
QbsProject *project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
|
|
||||||
const QbsProductNode * const productNode = dynamic_cast<const QbsProductNode *>(node);
|
const auto * const productNode = dynamic_cast<const QbsProductNode *>(node);
|
||||||
QTC_ASSERT(productNode, return);
|
QTC_ASSERT(productNode, return);
|
||||||
|
|
||||||
runStepsForProducts(project, {QbsProject::uniqueProductName(productNode->qbsProductData())},
|
runStepsForProducts(project, {QbsProject::uniqueProductName(productNode->qbsProductData())},
|
||||||
@@ -490,7 +490,7 @@ void QbsProjectManagerPlugin::runStepsForProduct(const QList<Core::Id> &stepType
|
|||||||
Node *node = currentEditorNode();
|
Node *node = currentEditorNode();
|
||||||
if (!node)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
QbsProductNode *product = dynamic_cast<QbsProductNode *>(node->parentProjectNode());
|
auto product = dynamic_cast<QbsProductNode *>(node->parentProjectNode());
|
||||||
if (!product)
|
if (!product)
|
||||||
return;
|
return;
|
||||||
QbsProject *project = currentEditorProject();
|
QbsProject *project = currentEditorProject();
|
||||||
@@ -522,10 +522,10 @@ void QbsProjectManagerPlugin::runStepsForSubprojectContextMenu(const QList<Core:
|
|||||||
{
|
{
|
||||||
const Node *node = ProjectTree::findCurrentNode();
|
const Node *node = ProjectTree::findCurrentNode();
|
||||||
QTC_ASSERT(node, return);
|
QTC_ASSERT(node, return);
|
||||||
QbsProject *project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
auto project = dynamic_cast<QbsProject *>(ProjectTree::currentProject());
|
||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
|
|
||||||
const QbsProjectNode *subProject = dynamic_cast<const QbsProjectNode *>(node);
|
const auto subProject = dynamic_cast<const QbsProjectNode *>(node);
|
||||||
QTC_ASSERT(subProject, return);
|
QTC_ASSERT(subProject, return);
|
||||||
|
|
||||||
QStringList toBuild;
|
QStringList toBuild;
|
||||||
@@ -560,10 +560,10 @@ void QbsProjectManagerPlugin::runStepsForSubproject(const QList<Core::Id> &stepT
|
|||||||
if (!editorNode || !editorProject)
|
if (!editorNode || !editorProject)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QbsProjectNode *subproject = 0;
|
QbsProjectNode *subproject = nullptr;
|
||||||
QbsBaseProjectNode *start = dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
auto start = dynamic_cast<QbsBaseProjectNode *>(editorNode->parentProjectNode());
|
||||||
while (start && start != editorProject->rootProjectNode()) {
|
while (start && start != editorProject->rootProjectNode()) {
|
||||||
QbsProjectNode *tmp = dynamic_cast<QbsProjectNode *>(start);
|
auto tmp = dynamic_cast<QbsProjectNode *>(start);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
subproject = tmp;
|
subproject = tmp;
|
||||||
break;
|
break;
|
||||||
@@ -590,7 +590,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
|||||||
Target *t = project->activeTarget();
|
Target *t = project->activeTarget();
|
||||||
if (!t)
|
if (!t)
|
||||||
return;
|
return;
|
||||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
auto bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -623,7 +623,7 @@ void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project,
|
|||||||
Target *t = project->activeTarget();
|
Target *t = project->activeTarget();
|
||||||
if (!t)
|
if (!t)
|
||||||
return;
|
return;
|
||||||
QbsBuildConfiguration *bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
auto bc = qobject_cast<QbsBuildConfiguration *>(t->activeBuildConfiguration());
|
||||||
if (!bc)
|
if (!bc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -49,8 +49,8 @@ namespace Internal {
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
QbsProjectParser::QbsProjectParser(QbsProject *project, QFutureInterface<bool> *fi) :
|
QbsProjectParser::QbsProjectParser(QbsProject *project, QFutureInterface<bool> *fi) :
|
||||||
m_qbsSetupProjectJob(0),
|
m_qbsSetupProjectJob(nullptr),
|
||||||
m_ruleExecutionJob(0),
|
m_ruleExecutionJob(nullptr),
|
||||||
m_fi(fi),
|
m_fi(fi),
|
||||||
m_currentProgressBase(0)
|
m_currentProgressBase(0)
|
||||||
{
|
{
|
||||||
@@ -75,7 +75,7 @@ QbsProjectParser::~QbsProjectParser()
|
|||||||
};
|
};
|
||||||
deleteJob(m_qbsSetupProjectJob);
|
deleteJob(m_qbsSetupProjectJob);
|
||||||
deleteJob(m_ruleExecutionJob);
|
deleteJob(m_ruleExecutionJob);
|
||||||
m_fi = 0; // we do not own m_fi, do not delete
|
m_fi = nullptr; // we do not own m_fi, do not delete
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, const QString &dir,
|
void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, const QString &dir,
|
||||||
@@ -114,7 +114,7 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
|
|||||||
params.setPropertyCheckingMode(qbs::ErrorHandlingMode::Relaxed);
|
params.setPropertyCheckingMode(qbs::ErrorHandlingMode::Relaxed);
|
||||||
params.setLogElapsedTime(!qEnvironmentVariableIsEmpty(Constants::QBS_PROFILING_ENV));
|
params.setLogElapsedTime(!qEnvironmentVariableIsEmpty(Constants::QBS_PROFILING_ENV));
|
||||||
|
|
||||||
m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0);
|
m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), nullptr);
|
||||||
|
|
||||||
connect(m_qbsSetupProjectJob, &qbs::AbstractJob::finished,
|
connect(m_qbsSetupProjectJob, &qbs::AbstractJob::finished,
|
||||||
this, &QbsProjectParser::handleQbsParsingDone);
|
this, &QbsProjectParser::handleQbsParsingDone);
|
||||||
|
@@ -44,7 +44,7 @@ class QbsProjectParser : public QObject
|
|||||||
public:
|
public:
|
||||||
QbsProjectParser(QbsProjectManager::Internal::QbsProject *project,
|
QbsProjectParser(QbsProjectManager::Internal::QbsProject *project,
|
||||||
QFutureInterface<bool> *fi);
|
QFutureInterface<bool> *fi);
|
||||||
~QbsProjectParser();
|
~QbsProjectParser() override;
|
||||||
|
|
||||||
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir,
|
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir,
|
||||||
const QString &configName);
|
const QString &configName);
|
||||||
|
@@ -81,7 +81,7 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target, Core::Id id)
|
|||||||
connect(target, &Target::kitChanged,
|
connect(target, &Target::kitChanged,
|
||||||
this, &QbsRunConfiguration::updateTargetInformation);
|
this, &QbsRunConfiguration::updateTargetInformation);
|
||||||
|
|
||||||
QbsProject *qbsProject = static_cast<QbsProject *>(target->project());
|
auto qbsProject = static_cast<QbsProject *>(target->project());
|
||||||
connect(qbsProject, &QbsProject::dataChanged, this, [this] { m_envCache.clear(); });
|
connect(qbsProject, &QbsProject::dataChanged, this, [this] { m_envCache.clear(); });
|
||||||
connect(qbsProject, &Project::parsingFinished,
|
connect(qbsProject, &Project::parsingFinished,
|
||||||
this, &QbsRunConfiguration::updateTargetInformation);
|
this, &QbsRunConfiguration::updateTargetInformation);
|
||||||
|
Reference in New Issue
Block a user