From fdb0cf0f6b45f25016e6f91685fb57304baddb8e Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 17 Apr 2020 14:23:21 +0300 Subject: [PATCH] Update openSslPath when we change the android sdk path Change-Id: I39bd02d4f5bba8d03d4606b0de89b50778c7aa01 Reviewed-by: Assam Boudjelthia --- src/plugins/android/androidsettingswidget.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 3d6d4d6f40a..95c67ae2645 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,10 @@ #include +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()) {