forked from qt-creator/qt-creator
ProjectExplorer: Add a ProjectConfiguration::target()
... with a suitable default implementation accessing a member populated at construction time instead of walking the parent chains on each access. Change-Id: I58dae6da80ed0b023cc603fca13a5a205b123672 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -158,21 +158,21 @@ QVariantMap QbsBuildConfiguration::qbsConfiguration() const
|
||||
return config;
|
||||
}
|
||||
|
||||
Internal::QbsProject *QbsBuildConfiguration::project() const
|
||||
Internal::QbsProject *QbsBuildConfiguration::qbsProject() const
|
||||
{
|
||||
return qobject_cast<Internal::QbsProject *>(BuildConfiguration::project());
|
||||
return qobject_cast<Internal::QbsProject *>(project());
|
||||
}
|
||||
|
||||
bool QbsBuildConfiguration::isEnabled() const
|
||||
{
|
||||
return !project()->isParsing() && project()->hasParseResult();
|
||||
return !project()->isParsing() && qbsProject()->hasParseResult();
|
||||
}
|
||||
|
||||
QString QbsBuildConfiguration::disabledReason() const
|
||||
{
|
||||
if (project()->isParsing())
|
||||
return tr("Parsing the Qbs project.");
|
||||
if (!project()->hasParseResult())
|
||||
if (!qbsProject()->hasParseResult())
|
||||
return tr("Parsing of Qbs project has failed.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
QbsBuildStep *qbsStep() const;
|
||||
QVariantMap qbsConfiguration() const;
|
||||
|
||||
Internal::QbsProject *project() const override;
|
||||
Internal::QbsProject *qbsProject() const;
|
||||
|
||||
bool isEnabled() const override;
|
||||
QString disabledReason() const override;
|
||||
|
||||
Reference in New Issue
Block a user