QtSupport: Split QtVersionFactory::create()

... into a 'canCreate()' and the actual creation, which can be
done by the already registered m_creator.

Simpler interface, with the (temporary) regression that the
EmbeddedLinuxQtVersion get constructed twice, once only to
determine that it should be alive afterwards. Will be fixed later.

Change-Id: I5da2cafe473b25a0207bbd628632c9a259780361
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-14 11:02:28 +01:00
parent ec6b38dea0
commit 3007105d86
14 changed files with 45 additions and 56 deletions

View File

@@ -39,11 +39,9 @@ IosQtVersionFactory::IosQtVersionFactory()
setPriority(90);
}
QtSupport::BaseQtVersion *IosQtVersionFactory::create(ProFileEvaluator *evaluator)
bool IosQtVersionFactory::canCreate(ProFileEvaluator *evaluator) const
{
if (!(evaluator->values(QLatin1String("QMAKE_PLATFORM")).contains(QLatin1String("ios"))))
return nullptr;
return new IosQtVersion;
return evaluator->values("QMAKE_PLATFORM").contains("ios");
}
} // Internal

View File

@@ -35,7 +35,7 @@ class IosQtVersionFactory : public QtSupport::QtVersionFactory
public:
IosQtVersionFactory();
QtSupport::BaseQtVersion *create(ProFileEvaluator *evaluator) override;
bool canCreate(ProFileEvaluator *evaluator) const override;
};
} // namespace Internal