Android: Speed up project opening by caching the sdk version

The slowness is due to AndroidToolChain::addToEnvironment() being called
a lot on project opening. Thus we need to avoid any file opening or
process on loading.

This patch does 2 things:
a) It removes the call to sdkTargets() which is unneeded. That actually
checks which avds are available.

b) It caches the target sdk inside a named target setting. That means,
we assume that the file does not change behind our backs.

Task-number: QTCREATORBUG-9164

Change-Id: I9287934a0624db0b3e8318b8cf76e605418850c2
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2013-04-19 16:27:31 +02:00
parent 1bdf7225f9
commit 4e37f1cd7f
4 changed files with 28 additions and 2 deletions

View File

@@ -118,8 +118,6 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
if (AndroidConfigurations::instance().config().ndkLocation.isEmpty()
|| AndroidConfigurations::instance().config().sdkLocation.isEmpty())
return;
if (AndroidConfigurations::instance().sdkTargets().isEmpty())
return;
env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(target)));