diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2020-06-11 15:51:20 +0300 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-06-15 07:58:23 +0000 |
commit | 759b38e2ac293a9b5d588c36949e4e7dacd31046 (patch) | |
tree | e8755c796c210877739ce3743c10529ecdcafe22 | |
parent | eabe281b1875bc8921bbb9aced393c030ac4df94 (diff) | |
download | qt-creator-759b38e2ac293a9b5d588c36949e4e7dacd31046.tar.gz |
Android: don't delete the openssl dir when cloning
Avoid removing the openssl dir if the selected path already exist
and is not empty, rather just recommend selecting a different path
or empty the provided one.
Fixes: QTCREATORBUG-24173
Change-Id: I1e501b361d4917a59a5720146b11580e79ac32aa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r-- | src/plugins/android/androidsettingswidget.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 95c67ae264..fb1e4c76c6 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -817,16 +817,16 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent) gitCloneCommand.toUserOutput(); QDir openSslDir(openSslPath.toString()); - if (openSslDir.exists()) { - auto userInput = QMessageBox::information(this, openSslCloneTitle, - tr("The selected download path (%1) for OpenSSL already exists. " - "Remove and overwrite its content?") - .arg(QDir::toNativeSeparators(openSslPath.toString())), - QMessageBox::Yes | QMessageBox::No); - if (userInput == QMessageBox::Yes) - openSslDir.removeRecursively(); - else - return; + const bool isEmptyDir = openSslDir.isEmpty(QDir::AllEntries | QDir::NoDotAndDotDot + | QDir::Hidden | QDir::System); + if (openSslDir.exists() && !isEmptyDir) { + QMessageBox::information( + this, + openSslCloneTitle, + tr("The selected download path (%1) for OpenSSL already exists and the directory is " + "not empty. Select a different path or make sure it is an empty directory.") + .arg(QDir::toNativeSeparators(openSslPath.toString()))); + return; } QProgressDialog *openSslProgressDialog |