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:
hjk
2019-02-14 12:15:48 +01:00
parent 4079dd5cbc
commit 7563cd6d39
12 changed files with 41 additions and 83 deletions

View File

@@ -26,8 +26,6 @@
#include "iosqtversionfactory.h"
#include "iosqtversion.h"
#include "iosconstants.h"
#include <qtsupport/qtsupportconstants.h>
#include <proparser/profileevaluator.h>
namespace Ios {
namespace Internal {
@@ -37,11 +35,10 @@ IosQtVersionFactory::IosQtVersionFactory()
setQtVersionCreator([] { return new IosQtVersion; });
setSupportedType(Constants::IOSQT);
setPriority(90);
}
bool IosQtVersionFactory::canCreate(ProFileEvaluator *evaluator) const
{
return evaluator->values("QMAKE_PLATFORM").contains("ios");
setRestrictionChecker([](const SetupData &setup) {
return setup.platforms.contains("ios");
});
}
} // Internal

View File

@@ -34,8 +34,6 @@ class IosQtVersionFactory : public QtSupport::QtVersionFactory
{
public:
IosQtVersionFactory();
bool canCreate(ProFileEvaluator *evaluator) const override;
};
} // namespace Internal