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:
@@ -40,14 +40,14 @@ AndroidQtVersionFactory::AndroidQtVersionFactory()
|
||||
setPriority(90);
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *AndroidQtVersionFactory::create(ProFileEvaluator *evaluator)
|
||||
bool AndroidQtVersionFactory::canCreate(ProFileEvaluator *evaluator) const
|
||||
{
|
||||
if (!evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("android"))
|
||||
&& evaluator->value(QLatin1String("QMAKE_PLATFORM")) != QLatin1String("android"))
|
||||
return nullptr;
|
||||
if (evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("android-no-sdk")))
|
||||
return nullptr;
|
||||
return new AndroidQtVersion;
|
||||
if (!evaluator->values("CONFIG").contains("android")
|
||||
&& evaluator->value("QMAKE_PLATFORM") != "android")
|
||||
return false;
|
||||
if (evaluator->values("CONFIG").contains("android-no-sdk"))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
||||
@@ -35,7 +35,7 @@ class AndroidQtVersionFactory : public QtSupport::QtVersionFactory
|
||||
public:
|
||||
AndroidQtVersionFactory();
|
||||
|
||||
QtSupport::BaseQtVersion *create(ProFileEvaluator *evaluator) override;
|
||||
bool canCreate(ProFileEvaluator *evaluator) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user