forked from qt-creator/qt-creator
Qbs: Properly report related runconfigurations for Qbs nodes
This fixes the run options in the context menu. Change-Id: If4911f7357329fcb843206165e20d53bf6717258 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -30,9 +30,11 @@
|
||||
#include "qbsnodes.h"
|
||||
|
||||
#include "qbsproject.h"
|
||||
#include "qbsrunconfiguration.h"
|
||||
|
||||
#include <coreplugin/fileiconprovider.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -460,6 +462,25 @@ void QbsProductNode::setQbsProductData(const qbs::ProductData *prd)
|
||||
emitNodeUpdated();
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::RunConfiguration *> QbsProductNode::runConfigurationsFor(ProjectExplorer::Node *node)
|
||||
{
|
||||
Q_UNUSED(node);
|
||||
QList<ProjectExplorer::RunConfiguration *> result;
|
||||
QbsProjectNode *pn = qobject_cast<QbsProjectNode *>(projectNode());
|
||||
if (!isEnabled() || !pn || pn->qbsProject()->targetExecutable(*m_qbsProductData).isEmpty())
|
||||
return result;
|
||||
|
||||
foreach (ProjectExplorer::RunConfiguration *rc, pn->project()->activeTarget()->runConfigurations()) {
|
||||
QbsRunConfiguration *qbsRc = qobject_cast<QbsRunConfiguration *>(rc);
|
||||
if (!qbsRc)
|
||||
continue;
|
||||
if (qbsRc->qbsProduct() == qbsProductData()->name())
|
||||
result << qbsRc;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QbsGroupNode *QbsProductNode::findGroupNode(const QString &name)
|
||||
{
|
||||
foreach (ProjectExplorer::ProjectNode *n, subProjectNodes()) {
|
||||
|
||||
Reference in New Issue
Block a user