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(QObject *parent, Core::Id id)
|
||||
: QObject(parent), m_id(id)
|
||||
: QObject(parent)
|
||||
, m_id(id)
|
||||
{
|
||||
QTC_CHECK(parent);
|
||||
QTC_CHECK(id.isValid());
|
||||
setObjectName(id.toString());
|
||||
|
||||
for (QObject *obj = this; obj; obj = obj->parent()) {
|
||||
m_target = qobject_cast<Target *>(obj);
|
||||
if (m_target != nullptr)
|
||||
if (m_target)
|
||||
break;
|
||||
}
|
||||
QTC_CHECK(m_target);
|
||||
@@ -149,7 +152,6 @@ QVariantMap ProjectConfiguration::toMap() const
|
||||
Target *ProjectConfiguration::target() const
|
||||
{
|
||||
return m_target;
|
||||
|
||||
}
|
||||
|
||||
bool ProjectConfiguration::fromMap(const QVariantMap &map)
|
||||
|
||||
@@ -182,7 +182,6 @@ protected:
|
||||
ProjectConfigurationAspects m_aspects;
|
||||
|
||||
private:
|
||||
friend class Target; // FIXME: Remove
|
||||
Target *m_target = nullptr;
|
||||
const Core::Id m_id;
|
||||
Utils::DisplayName m_displayName;
|
||||
|
||||
Reference in New Issue
Block a user