forked from qt-creator/qt-creator
ProjectConfiguration: Clean up initialization of m_target
Change-Id: I28290c5fe1d9505f78157a2a62af1e24589d13b2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -82,13 +82,16 @@ void ProjectConfigurationAspects::toMap(QVariantMap &map) const
|
|||||||
// ProjectConfiguration
|
// ProjectConfiguration
|
||||||
|
|
||||||
ProjectConfiguration::ProjectConfiguration(QObject *parent, Core::Id id)
|
ProjectConfiguration::ProjectConfiguration(QObject *parent, Core::Id id)
|
||||||
: QObject(parent), m_id(id)
|
: QObject(parent)
|
||||||
|
, m_id(id)
|
||||||
{
|
{
|
||||||
|
QTC_CHECK(parent);
|
||||||
QTC_CHECK(id.isValid());
|
QTC_CHECK(id.isValid());
|
||||||
setObjectName(id.toString());
|
setObjectName(id.toString());
|
||||||
|
|
||||||
for (QObject *obj = this; obj; obj = obj->parent()) {
|
for (QObject *obj = this; obj; obj = obj->parent()) {
|
||||||
m_target = qobject_cast<Target *>(obj);
|
m_target = qobject_cast<Target *>(obj);
|
||||||
if (m_target != nullptr)
|
if (m_target)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QTC_CHECK(m_target);
|
QTC_CHECK(m_target);
|
||||||
@@ -149,7 +152,6 @@ QVariantMap ProjectConfiguration::toMap() const
|
|||||||
Target *ProjectConfiguration::target() const
|
Target *ProjectConfiguration::target() const
|
||||||
{
|
{
|
||||||
return m_target;
|
return m_target;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProjectConfiguration::fromMap(const QVariantMap &map)
|
bool ProjectConfiguration::fromMap(const QVariantMap &map)
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ protected:
|
|||||||
ProjectConfigurationAspects m_aspects;
|
ProjectConfigurationAspects m_aspects;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Target; // FIXME: Remove
|
|
||||||
Target *m_target = nullptr;
|
Target *m_target = nullptr;
|
||||||
const Core::Id m_id;
|
const Core::Id m_id;
|
||||||
Utils::DisplayName m_displayName;
|
Utils::DisplayName m_displayName;
|
||||||
|
|||||||
Reference in New Issue
Block a user