Update openSslPath when we change the android sdk path

Change-Id: I39bd02d4f5bba8d03d4606b0de89b50778c7aa01
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
BogDan Vatra
2020-04-17 14:23:21 +03:00
committed by BogDan Vatra
parent f671d46c1d
commit fdb0cf0f6b

View File

@@ -57,6 +57,7 @@
#include <QFileDialog>
#include <QFutureWatcher>
#include <QList>
#include <QLoggingCategory>
#include <QMessageBox>
#include <QModelIndex>
#include <QSettings>
@@ -67,6 +68,10 @@
#include <memory>
namespace {
static Q_LOGGING_CATEGORY(androidsettingswidget, "qtc.android.androidsettingswidget", QtWarningMsg);
}
namespace Android {
namespace Internal {
@@ -719,6 +724,10 @@ void AndroidSettingsWidget::onSdkPathChanged()
{
auto sdkPath = Utils::FilePath::fromUserInput(m_ui->SDKLocationPathChooser->rawPath());
m_androidConfig.setSdkLocation(sdkPath);
Utils::FilePath currentOpenSslPath = m_androidConfig.openSslLocation();
if (currentOpenSslPath.isEmpty() || !currentOpenSslPath.exists())
currentOpenSslPath = sdkPath.pathAppended("android_openssl");
m_ui->openSslPathChooser->setFileName(currentOpenSslPath);
// Package reload will trigger validateSdk.
m_sdkManager->reloadPackages();
}
@@ -800,8 +809,12 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
const QString openSslRepo("https://github.com/KDAB/android_openssl.git");
Utils::QtcProcess *gitCloner = new Utils::QtcProcess(this);
gitCloner->setCommand(Utils::CommandLine("git", {"clone", "--depth=1", openSslRepo, openSslPath.fileName()}));
gitCloner->setWorkingDirectory(openSslPath.parentDir().toString());
Utils::CommandLine gitCloneCommand("git",
{"clone", "--depth=1", openSslRepo, openSslPath.toString()});
gitCloner->setCommand(gitCloneCommand);
qCDebug(androidsettingswidget) << "Cloning OpenSSL repo: " <<
gitCloneCommand.toUserOutput();
QDir openSslDir(openSslPath.toString());
if (openSslDir.exists()) {