diff options
author | BogDan Vatra <bogdan@kde.org> | 2020-04-17 14:23:21 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2020-04-17 13:04:38 +0000 |
commit | fdb0cf0f6b45f25016e6f91685fb57304baddb8e (patch) | |
tree | 6b664bba19114d572d4a6084859e1a97c9450735 | |
parent | f671d46c1dc41c7ecefe2b83f3af115a7e30ea90 (diff) |
Update openSslPath when we change the android sdk path
Change-Id: I39bd02d4f5bba8d03d4606b0de89b50778c7aa01
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
-rw-r--r-- | src/plugins/android/androidsettingswidget.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 3d6d4d6f40..95c67ae264 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -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()) { |