Commit 5e10114e authored by Daniel Teske's avatar Daniel Teske

Android: Remove bestMatch calls in fallback code in buildTargetSDK

besdtMatch finds a ndk version that is at most the targetApi passed into it.
Since we are passing in the fallback and lowest possible api level that qt
supports, the function would return at most the lowest supported version.
That's not very useful and cannot have worked, so simpy return the fallback
version directly.

Change-Id: I5e4757639099af4d207f928b0335d28efd75a02b
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent c30c2906
......@@ -237,17 +237,17 @@ QString AndroidManager::buildTargetSDK(ProjectExplorer::Target *target)
fallback = QLatin1String("android-9");
if (!createAndroidTemplatesIfNecessary(target))
return AndroidConfigurations::instance().bestMatch(fallback);
return fallback;
QFile file(defaultPropertiesPath(target).toString());
if (!file.open(QIODevice::ReadOnly))
return AndroidConfigurations::instance().bestMatch(fallback);
return fallback;
while (!file.atEnd()) {
QByteArray line = file.readLine();
if (line.startsWith("target="))
return QString::fromLatin1(line.trimmed().mid(7));
}
return AndroidConfigurations::instance().bestMatch(fallback);
return fallback;
}
bool AndroidManager::setBuildTargetSDK(ProjectExplorer::Target *target, const QString &sdk)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment