diff options
author | Vikas Pachdha <vikas.pachdha@qt.io> | 2017-05-18 10:37:19 +0200 |
---|---|---|
committer | Vikas Pachdha <vikas.pachdha@qt.io> | 2017-05-18 10:51:19 +0000 |
commit | 0093e4a2633f33e6ce5609fe74fdf9733ad4203f (patch) | |
tree | 1ce0479e8e69b518195486d7346b6ffb9297529f /src/plugins/android | |
parent | 9ea07a2fbc9f3aa6f313b3dfb826363b76bfe51f (diff) | |
download | qt-creator-0093e4a2633f33e6ce5609fe74fdf9733ad4203f.tar.gz |
Android: Fix android kit missing compiler on NDK path change
Task-number: QTCREATORBUG-18221
Change-Id: I4481d252064476f905a02a53c487664f3e1d4a4c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/android')
-rw-r--r-- | src/plugins/android/androidconfigurations.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 1287f4946f..5e2c8eb395 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1044,7 +1044,6 @@ void AndroidConfigurations::updateAutomaticKitList() } // register new kits - QList<Kit *> newKits; const QList<ToolChain *> tmp = ToolChainManager::toolChains([](const ToolChain *tc) { return tc->isAutoDetected() && tc->isValid() @@ -1061,19 +1060,27 @@ void AndroidConfigurations::updateAutomaticKitList() [tc](AndroidToolChain *otherTc) { return tc->targetAbi() == otherTc->targetAbi(); }); - for (const QtSupport::BaseQtVersion *qt : qtVersionsForArch.value(tc->targetAbi())) { - Kit *newKit = new Kit; - newKit->setAutoDetected(true); - newKit->setAutoDetectionSource("AndroidConfiguration"); - DeviceTypeKitInformation::setDeviceTypeId(newKit, Core::Id(Constants::ANDROID_DEVICE_TYPE)); + + auto initBasicKitData = [allLanguages, device](Kit *k, const QtSupport::BaseQtVersion *qt) { + k->setAutoDetected(true); + k->setAutoDetectionSource("AndroidConfiguration"); + DeviceTypeKitInformation::setDeviceTypeId(k, Core::Id(Constants::ANDROID_DEVICE_TYPE)); for (AndroidToolChain *tc : allLanguages) - ToolChainKitInformation::setToolChain(newKit, tc); - QtSupport::QtKitInformation::setQtVersion(newKit, qt); - DeviceKitInformation::setDevice(newKit, device); + ToolChainKitInformation::setToolChain(k, tc); + QtSupport::QtKitInformation::setQtVersion(k, qt); + DeviceKitInformation::setDevice(k, device); + }; - auto findExistingKit = [newKit](const Kit *k) { return matchKits(newKit, k); }; - Kit *existingKit = Utils::findOrDefault(existingKits, findExistingKit); + for (const QtSupport::BaseQtVersion *qt : qtVersionsForArch.value(tc->targetAbi())) { + Kit *newKit = new Kit; + initBasicKitData(newKit, qt); + Kit *existingKit = Utils::findOrDefault(existingKits, [newKit](const Kit *k) { + return matchKits(newKit, k); + }); if (existingKit) { + // Existing kit found. + // Update the existing kit with new data. + initBasicKitData(existingKit, qt); KitManager::deleteKit(newKit); newKit = existingKit; } |