Commit afbfcf8d authored by Tim Jenssen's avatar Tim Jenssen Committed by Tobias Hunger

ProjectConfiguration: Add project() member

Change-Id: I0a7170c1721a9e5bcf18af1bab8158af71c64454
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent e8c57c98
...@@ -226,6 +226,11 @@ Target *BuildConfiguration::target() const ...@@ -226,6 +226,11 @@ Target *BuildConfiguration::target() const
return static_cast<Target *>(parent()); return static_cast<Target *>(parent());
} }
Project *BuildConfiguration::project() const
{
return target()->project();
}
Utils::Environment BuildConfiguration::baseEnvironment() const Utils::Environment BuildConfiguration::baseEnvironment() const
{ {
Utils::Environment result; Utils::Environment result;
......
...@@ -73,6 +73,7 @@ public: ...@@ -73,6 +73,7 @@ public:
QVariantMap toMap() const override; QVariantMap toMap() const override;
Target *target() const; Target *target() const;
Project *project() const override;
virtual bool isEnabled() const; virtual bool isEnabled() const;
virtual QString disabledReason() const; virtual QString disabledReason() const;
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
DeployConfiguration *deployConfiguration() const; DeployConfiguration *deployConfiguration() const;
ProjectConfiguration *projectConfiguration() const; ProjectConfiguration *projectConfiguration() const;
Target *target() const; Target *target() const;
Project *project() const; Project *project() const override;
enum class OutputFormat { enum class OutputFormat {
Stdout, Stderr, // These are for forwarded output from external tools Stdout, Stderr, // These are for forwarded output from external tools
......
...@@ -198,3 +198,8 @@ Target *BuildStepList::target() const ...@@ -198,3 +198,8 @@ Target *BuildStepList::target() const
return dc->target(); return dc->target();
return 0; return 0;
} }
Project *BuildStepList::project() const
{
return target()->project();
}
...@@ -78,6 +78,7 @@ public: ...@@ -78,6 +78,7 @@ public:
BuildStep *at(int position); BuildStep *at(int position);
Target *target() const; Target *target() const;
Project *project() const override;
virtual QVariantMap toMap() const override; virtual QVariantMap toMap() const override;
virtual bool fromMap(const QVariantMap &map) override; virtual bool fromMap(const QVariantMap &map) override;
......
...@@ -141,6 +141,11 @@ Target *DeployConfiguration::target() const ...@@ -141,6 +141,11 @@ Target *DeployConfiguration::target() const
return static_cast<Target *>(parent()); return static_cast<Target *>(parent());
} }
Project *DeployConfiguration::project() const
{
return target()->project();
}
void DeployConfiguration::cloneSteps(DeployConfiguration *source) void DeployConfiguration::cloneSteps(DeployConfiguration *source)
{ {
if (source == this) if (source == this)
......
...@@ -59,6 +59,7 @@ public: ...@@ -59,6 +59,7 @@ public:
virtual QString disabledReason() const; virtual QString disabledReason() const;
Target *target() const; Target *target() const;
Project *project() const override;
signals: signals:
void enabledChanged(); void enabledChanged();
......
...@@ -65,6 +65,8 @@ public: ...@@ -65,6 +65,8 @@ public:
Utils::MacroExpander *macroExpander() { return &m_macroExpander; } Utils::MacroExpander *macroExpander() { return &m_macroExpander; }
const Utils::MacroExpander *macroExpander() const { return &m_macroExpander; } const Utils::MacroExpander *macroExpander() const { return &m_macroExpander; }
virtual Project *project() const = 0;
signals: signals:
void displayNameChanged(); void displayNameChanged();
void toolTipChanged(); void toolTipChanged();
......
...@@ -315,6 +315,11 @@ Target *RunConfiguration::target() const ...@@ -315,6 +315,11 @@ Target *RunConfiguration::target() const
return static_cast<Target *>(parent()); return static_cast<Target *>(parent());
} }
Project *RunConfiguration::project() const
{
return target()->project();
}
QVariantMap RunConfiguration::toMap() const QVariantMap RunConfiguration::toMap() const
{ {
QVariantMap map = ProjectConfiguration::toMap(); QVariantMap map = ProjectConfiguration::toMap();
......
...@@ -217,6 +217,7 @@ public: ...@@ -217,6 +217,7 @@ public:
virtual ConfigurationState ensureConfigured(QString *errorMessage = nullptr); virtual ConfigurationState ensureConfigured(QString *errorMessage = nullptr);
Target *target() const; Target *target() const;
Project *project() const override;
virtual Utils::OutputFormatter *createOutputFormatter() const; virtual Utils::OutputFormatter *createOutputFormatter() const;
......
...@@ -55,7 +55,7 @@ class PROJECTEXPLORER_EXPORT Target : public ProjectConfiguration ...@@ -55,7 +55,7 @@ class PROJECTEXPLORER_EXPORT Target : public ProjectConfiguration
public: public:
~Target() override; ~Target() override;
Project *project() const; Project *project() const override;
// Kit: // Kit:
Kit *kit() const; Kit *kit() const;
......
...@@ -147,7 +147,7 @@ QVariantMap QbsBuildConfiguration::qbsConfiguration() const ...@@ -147,7 +147,7 @@ QVariantMap QbsBuildConfiguration::qbsConfiguration() const
Internal::QbsProject *QbsBuildConfiguration::project() const Internal::QbsProject *QbsBuildConfiguration::project() const
{ {
return qobject_cast<Internal::QbsProject *>(target()->project()); return qobject_cast<Internal::QbsProject *>(BuildConfiguration::project());
} }
IOutputParser *QbsBuildConfiguration::createOutputParser() const IOutputParser *QbsBuildConfiguration::createOutputParser() const
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "qbsprojectmanager_global.h" #include "qbsprojectmanager_global.h"
#include "qbsproject.h"
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
...@@ -56,7 +58,7 @@ public: ...@@ -56,7 +58,7 @@ public:
QbsBuildStep *qbsStep() const; QbsBuildStep *qbsStep() const;
QVariantMap qbsConfiguration() const; QVariantMap qbsConfiguration() const;
Internal::QbsProject *project() const; Internal::QbsProject *project() const override;
ProjectExplorer::IOutputParser *createOutputParser() const; ProjectExplorer::IOutputParser *createOutputParser() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment