From 759b38e2ac293a9b5d588c36949e4e7dacd31046 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Thu, 11 Jun 2020 15:51:20 +0300 Subject: [PATCH] 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 Reviewed-by: Eike Ziller Reviewed-by: Leena Miettinen --- src/plugins/android/androidsettingswidget.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 95c67ae2645..fb1e4c76c6b 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