forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Eike Ziller
parent
eabe281b18
commit
759b38e2ac
@@ -817,15 +817,15 @@ 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
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user