summaryrefslogtreecommitdiff
path: root/src/plugins/remotelinux
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-02-14 11:02:28 +0100
committerhjk <hjk@qt.io>2019-02-15 15:50:50 +0000
commit3007105d86be5bfd3016277eedb557cda01eeabf (patch)
tree42f1696acce015cc9971ceedd3a16a09721ef3ef /src/plugins/remotelinux
parentec6b38dea0a9c7f5b2b45dff6cbb2b1479f44878 (diff)
downloadqt-creator-3007105d86be5bfd3016277eedb557cda01eeabf.tar.gz
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>
Diffstat (limited to 'src/plugins/remotelinux')
-rw-r--r--src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp14
-rw-r--r--src/plugins/remotelinux/embeddedlinuxqtversionfactory.h2
2 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp
index 74b7bd106a..1ff52d2960 100644
--- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp
+++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.cpp
@@ -40,21 +40,17 @@ EmbeddedLinuxQtVersionFactory::EmbeddedLinuxQtVersionFactory()
setPriority(10);
}
-QtSupport::BaseQtVersion *EmbeddedLinuxQtVersionFactory::create(ProFileEvaluator *evaluator)
+bool EmbeddedLinuxQtVersionFactory::canCreate(ProFileEvaluator *evaluator) const
{
Q_UNUSED(evaluator);
- auto version = new EmbeddedLinuxQtVersion;
+ EmbeddedLinuxQtVersion tempVersion;
+ QList<ProjectExplorer::Abi> abis = tempVersion.qtAbis();
- QList<ProjectExplorer::Abi> abis = version->qtAbis();
// Note: This fails for e.g. intel/meego cross builds on x86 linux machines.
- if (abis.count() == 1
+ return abis.count() == 1
&& abis.at(0).os() == ProjectExplorer::Abi::LinuxOS
- && !ProjectExplorer::Abi::hostAbi().isCompatibleWith(abis.at(0)))
- return version;
-
- delete version;
- return nullptr;
+ && !ProjectExplorer::Abi::hostAbi().isCompatibleWith(abis.at(0));
}
} // namespace Internal
diff --git a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h
index 7e341acb2f..11dbdf6480 100644
--- a/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h
+++ b/src/plugins/remotelinux/embeddedlinuxqtversionfactory.h
@@ -35,7 +35,7 @@ class EmbeddedLinuxQtVersionFactory : public QtSupport::QtVersionFactory
public:
EmbeddedLinuxQtVersionFactory();
- QtSupport::BaseQtVersion *create(ProFileEvaluator *evaluator) override;
+ bool canCreate(ProFileEvaluator *evaluator) const override;
};
} // Internal