aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-07-20 19:07:28 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2020-07-22 08:29:11 +0000
commit4d94f959f80836fbad475a18be6dc0083bc1dbb8 (patch)
tree83a774c2df6df04e868d200a3dfb6c28cd22dd78 /src/plugins/android
parent168adf6cc6253a5584b943aa01e89c04392526ee (diff)
Android: Fix initial validating with clean settings and default paths
Relying on the PathChooser::rawPathChanged handlers to initially validate default paths with clean settings does not work (I think) because of a mix of interdependent (via m_androidConfig) synchronous and asynchronous validations. Let's assign the initial values for jdk, sdk and openssl also to m_androidConfig, so that everything works on the first run. Task-number: QTCREATORBUG-24372 Change-Id: Id6945d7bf81949a1f90cd20f9b3bd4e14a5bbe07 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/plugins/android')
-rw-r--r--src/plugins/android/androidsettingswidget.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index 7587b4ea46..c446a0ed13 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -404,24 +404,20 @@ AndroidSettingsWidget::AndroidSettingsWidget()
connect(m_ui.OpenJDKLocationPathChooser, &PathChooser::rawPathChanged,
this, &AndroidSettingsWidget::validateJdk);
- FilePath currentJdkPath = m_androidConfig.openJDKLocation();
- if (currentJdkPath.isEmpty())
- currentJdkPath = AndroidConfig::getJdkPath();
- m_ui.OpenJDKLocationPathChooser->setFilePath(currentJdkPath);
+ if (m_androidConfig.openJDKLocation().isEmpty())
+ m_androidConfig.setOpenJDKLocation(AndroidConfig::getJdkPath());
+ m_ui.OpenJDKLocationPathChooser->setFilePath(m_androidConfig.openJDKLocation());
m_ui.OpenJDKLocationPathChooser->setPromptDialogTitle(tr("Select JDK Path"));
- FilePath currentSDKPath = m_androidConfig.sdkLocation();
- if (currentSDKPath.isEmpty())
- currentSDKPath = AndroidConfig::defaultSdkPath();
-
- m_ui.SDKLocationPathChooser->setFilePath(currentSDKPath);
+ if (m_androidConfig.sdkLocation().isEmpty())
+ m_androidConfig.setSdkLocation(AndroidConfig::defaultSdkPath());
+ m_ui.SDKLocationPathChooser->setFilePath(m_androidConfig.sdkLocation());
m_ui.SDKLocationPathChooser->setPromptDialogTitle(tr("Select Android SDK Folder"));
m_ui.openSslPathChooser->setPromptDialogTitle(tr("Select OpenSSL Include Project File"));
- FilePath currentOpenSslPath = m_androidConfig.openSslLocation();
- if (currentOpenSslPath.isEmpty())
- currentOpenSslPath = currentSDKPath.pathAppended("android_openssl");
- m_ui.openSslPathChooser->setFilePath(currentOpenSslPath);
+ if (m_androidConfig.openSslLocation().isEmpty())
+ m_androidConfig.setOpenSslLocation(m_androidConfig.sdkLocation() / ("android_openssl"));
+ m_ui.openSslPathChooser->setFilePath(m_androidConfig.openSslLocation());
m_ui.DataPartitionSizeSpinBox->setValue(m_androidConfig.partitionSize());
m_ui.CreateKitCheckBox->setChecked(m_androidConfig.automaticKitCreation());