diff options
author | hjk <hjk@qt.io> | 2019-02-14 12:15:48 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-02-15 16:07:11 +0000 |
commit | 7563cd6d394be51d38859175f336ead15a7df721 (patch) | |
tree | 9fdf89aa975030bde414b698452b18d1a50cbf2a /src/plugins/remotelinux | |
parent | 4079dd5cbccc6471005d5e5ab86a564de02aa5c0 (diff) | |
download | qt-creator-7563cd6d394be51d38859175f336ead15a7df721.tar.gz |
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>
Diffstat (limited to 'src/plugins/remotelinux')
-rw-r--r-- | src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp | 21 | ||||
-rw-r--r-- | src/plugins/remotelinux/embeddedlinuxqtversionfactory.h | 2 |
2 files changed, 8 insertions, 15 deletions
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp index 1ff52d2960..e657e81fa4 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp +++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp @@ -28,8 +28,6 @@ #include "embeddedlinuxqtversion.h" #include "remotelinux_constants.h" -#include <QFileInfo> - namespace RemoteLinux { namespace Internal { @@ -38,19 +36,16 @@ EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory() setQtVersionCreator([] { return new EmbeddedLinuxQtVersion; }); setSupportedType(RemoteLinux::Constants::EMBEDDED_LINUX_QT); setPriority(10); -} - -bool EmbeddedLinuxQtVersionFactory::canCreate(ProFileEvaluator *evaluator) const -{ - Q_UNUSED(evaluator); - EmbeddedLinuxQtVersion tempVersion; - QList<ProjectExplorer::Abi> abis = tempVersion.qtAbis(); + setRestrictionChecker([](const SetupData &) { + EmbeddedLinuxQtVersion tempVersion; + QList<ProjectExplorer::Abi> abis = tempVersion.qtAbis(); - // Note: This fails for e.g. intel/meego cross builds on x86 linux machines. - return abis.count() == 1 - && abis.at(0).os() == ProjectExplorer::Abi::LinuxOS - && !ProjectExplorer::Abi::hostAbi().isCompatibleWith(abis.at(0)); + // Note: This fails for e.g. intel/meego cross builds on x86 linux machines. + return abis.count() == 1 + && abis.at(0).os() == ProjectExplorer::Abi::LinuxOS + && !ProjectExplorer::Abi::hostAbi().isCompatibleWith(abis.at(0)); + }); } } // namespace Internal diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h index 11dbdf6480..2bcbbcae40 100644 --- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h +++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h @@ -34,8 +34,6 @@ class EmbeddedLinuxQtVersionFactory : public QtSupport::QtVersionFactory { public: EmbeddedLinuxQtVersionFactory(); - - bool canCreate(ProFileEvaluator *evaluator) const override; }; } // Internal |