forked from qt-creator/qt-creator
QtSupport: Replace QtVersionFactory::canCreate
... by a functor checking some ad-hoc custom structure content. This effectively replaces one ugliness (access to qmake specific variable via qmake specific ProFileEvaluator) by an indirection layer with similarly ungeneric contents, but I like the latter setup better. Change-Id: Iaee07c992fce4aabee2f4eae32a2413d772fe945 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -26,9 +26,6 @@
|
||||
#include "androidqtversionfactory.h"
|
||||
#include "androidqtversion.h"
|
||||
#include "androidconstants.h"
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <proparser/profileevaluator.h>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
@@ -38,15 +35,12 @@ AndroidQtVersionFactory::AndroidQtVersionFactory()
|
||||
setQtVersionCreator([] { return new AndroidQtVersion; });
|
||||
setSupportedType(Constants::ANDROIDQT);
|
||||
setPriority(90);
|
||||
}
|
||||
|
||||
bool AndroidQtVersionFactory::canCreate(ProFileEvaluator *evaluator) const
|
||||
{
|
||||
if (evaluator->values("CONFIG").contains("android-no-sdk"))
|
||||
return false;
|
||||
|
||||
return evaluator->values("CONFIG").contains("android")
|
||||
|| evaluator->value("QMAKE_PLATFORM") == "android";
|
||||
setRestrictionChecker([](const SetupData &setup) {
|
||||
return !setup.config.contains("android-no-sdk")
|
||||
&& (setup.config.contains("android")
|
||||
|| setup.platforms.contains("android"));
|
||||
});
|
||||
}
|
||||
|
||||
} // Internal
|
||||
|
||||
@@ -34,8 +34,6 @@ class AndroidQtVersionFactory : public QtSupport::QtVersionFactory
|
||||
{
|
||||
public:
|
||||
AndroidQtVersionFactory();
|
||||
|
||||
bool canCreate(ProFileEvaluator *evaluator) const override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user