forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user