forked from qt-creator/qt-creator
ProjectConfiguration: Add project() member
Change-Id: I0a7170c1721a9e5bcf18af1bab8158af71c64454 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Tobias Hunger
parent
e8c57c98d6
commit
afbfcf8d70
@@ -226,6 +226,11 @@ Target *BuildConfiguration::target() const
|
||||
return static_cast<Target *>(parent());
|
||||
}
|
||||
|
||||
Project *BuildConfiguration::project() const
|
||||
{
|
||||
return target()->project();
|
||||
}
|
||||
|
||||
Utils::Environment BuildConfiguration::baseEnvironment() const
|
||||
{
|
||||
Utils::Environment result;
|
||||
|
||||
@@ -73,6 +73,7 @@ public:
|
||||
QVariantMap toMap() const override;
|
||||
|
||||
Target *target() const;
|
||||
Project *project() const override;
|
||||
|
||||
virtual bool isEnabled() const;
|
||||
virtual QString disabledReason() const;
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
DeployConfiguration *deployConfiguration() const;
|
||||
ProjectConfiguration *projectConfiguration() const;
|
||||
Target *target() const;
|
||||
Project *project() const;
|
||||
Project *project() const override;
|
||||
|
||||
enum class OutputFormat {
|
||||
Stdout, Stderr, // These are for forwarded output from external tools
|
||||
|
||||
@@ -198,3 +198,8 @@ Target *BuildStepList::target() const
|
||||
return dc->target();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Project *BuildStepList::project() const
|
||||
{
|
||||
return target()->project();
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
BuildStep *at(int position);
|
||||
|
||||
Target *target() const;
|
||||
Project *project() const override;
|
||||
|
||||
virtual QVariantMap toMap() const override;
|
||||
virtual bool fromMap(const QVariantMap &map) override;
|
||||
|
||||
@@ -141,6 +141,11 @@ Target *DeployConfiguration::target() const
|
||||
return static_cast<Target *>(parent());
|
||||
}
|
||||
|
||||
Project *DeployConfiguration::project() const
|
||||
{
|
||||
return target()->project();
|
||||
}
|
||||
|
||||
void DeployConfiguration::cloneSteps(DeployConfiguration *source)
|
||||
{
|
||||
if (source == this)
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
virtual QString disabledReason() const;
|
||||
|
||||
Target *target() const;
|
||||
Project *project() const override;
|
||||
|
||||
signals:
|
||||
void enabledChanged();
|
||||
|
||||
@@ -65,6 +65,8 @@ public:
|
||||
Utils::MacroExpander *macroExpander() { return &m_macroExpander; }
|
||||
const Utils::MacroExpander *macroExpander() const { return &m_macroExpander; }
|
||||
|
||||
virtual Project *project() const = 0;
|
||||
|
||||
signals:
|
||||
void displayNameChanged();
|
||||
void toolTipChanged();
|
||||
|
||||
@@ -315,6 +315,11 @@ Target *RunConfiguration::target() const
|
||||
return static_cast<Target *>(parent());
|
||||
}
|
||||
|
||||
Project *RunConfiguration::project() const
|
||||
{
|
||||
return target()->project();
|
||||
}
|
||||
|
||||
QVariantMap RunConfiguration::toMap() const
|
||||
{
|
||||
QVariantMap map = ProjectConfiguration::toMap();
|
||||
|
||||
@@ -217,6 +217,7 @@ public:
|
||||
virtual ConfigurationState ensureConfigured(QString *errorMessage = nullptr);
|
||||
|
||||
Target *target() const;
|
||||
Project *project() const override;
|
||||
|
||||
virtual Utils::OutputFormatter *createOutputFormatter() const;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class PROJECTEXPLORER_EXPORT Target : public ProjectConfiguration
|
||||
public:
|
||||
~Target() override;
|
||||
|
||||
Project *project() const;
|
||||
Project *project() const override;
|
||||
|
||||
// Kit:
|
||||
Kit *kit() const;
|
||||
|
||||
@@ -147,7 +147,7 @@ QVariantMap QbsBuildConfiguration::qbsConfiguration() const
|
||||
|
||||
Internal::QbsProject *QbsBuildConfiguration::project() const
|
||||
{
|
||||
return qobject_cast<Internal::QbsProject *>(target()->project());
|
||||
return qobject_cast<Internal::QbsProject *>(BuildConfiguration::project());
|
||||
}
|
||||
|
||||
IOutputParser *QbsBuildConfiguration::createOutputParser() const
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "qbsprojectmanager_global.h"
|
||||
|
||||
#include "qbsproject.h"
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
|
||||
@@ -56,7 +58,7 @@ public:
|
||||
QbsBuildStep *qbsStep() const;
|
||||
QVariantMap qbsConfiguration() const;
|
||||
|
||||
Internal::QbsProject *project() const;
|
||||
Internal::QbsProject *project() const override;
|
||||
|
||||
ProjectExplorer::IOutputParser *createOutputParser() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user