QtSupport: Move qmake existence check out of *QtVersionFactory::create

Test globally in advance instead. For two factories that means a stricter
check on the qmake executable but with qmake being a host tool the additional
exists/executable check should be in order.

Change-Id: Ib07ef19aeee2d0a19d4c38e178f3e20d22867c2c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-14 08:18:36 +01:00
parent d39dd1e5bd
commit 1588205544
7 changed files with 7 additions and 34 deletions

View File

@@ -30,8 +30,6 @@
#include <utils/qtcassert.h>
#include <proparser/profileevaluator.h>
#include <QFileInfo>
namespace Android {
namespace Internal {
@@ -45,9 +43,6 @@ AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
QtSupport::BaseQtVersion *AndroidQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return nullptr;
if (!evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("android"))
&& evaluator->value(QLatin1String("QMAKE_PLATFORM")) != QLatin1String("android"))
return nullptr;