forked from qt-creator/qt-creator
AndroidSettingsWidget: Fix some issues
1. Don't create gitCloner if we are not going to start it, i.e. when we early return with QMessageBox::information(). 2. Pass a context object of *this into gitCloner connection. 3. Don't kill the gitCloner, deleteLater() instead. Change-Id: Ibb68627ed8d16e2dc43c9d63761609c8b8c82db0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -591,13 +591,6 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
return;
|
||||
}
|
||||
|
||||
const QString openSslRepo("https://github.com/KDAB/android_openssl.git");
|
||||
QtcProcess *gitCloner = new QtcProcess(this);
|
||||
CommandLine gitCloneCommand("git", {"clone", "--depth=1", openSslRepo, openSslPath.toString()});
|
||||
gitCloner->setCommand(gitCloneCommand);
|
||||
|
||||
qCDebug(androidsettingswidget) << "Cloning OpenSSL repo: " << gitCloneCommand.toUserOutput();
|
||||
|
||||
QDir openSslDir(openSslPath.toString());
|
||||
const bool isEmptyDir = openSslDir.isEmpty(QDir::AllEntries | QDir::NoDotAndDotDot
|
||||
| QDir::Hidden | QDir::System);
|
||||
@@ -618,7 +611,14 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
openSslProgressDialog->setWindowTitle(openSslCloneTitle);
|
||||
openSslProgressDialog->setFixedSize(openSslProgressDialog->sizeHint());
|
||||
|
||||
connect(openSslProgressDialog, &QProgressDialog::canceled, gitCloner, &QtcProcess::kill);
|
||||
const QString openSslRepo("https://github.com/KDAB/android_openssl.git");
|
||||
QtcProcess *gitCloner = new QtcProcess(this);
|
||||
CommandLine gitCloneCommand("git", {"clone", "--depth=1", openSslRepo, openSslPath.toString()});
|
||||
gitCloner->setCommand(gitCloneCommand);
|
||||
|
||||
qCDebug(androidsettingswidget) << "Cloning OpenSSL repo: " << gitCloneCommand.toUserOutput();
|
||||
|
||||
connect(openSslProgressDialog, &QProgressDialog::canceled, gitCloner, &QObject::deleteLater);
|
||||
|
||||
auto failDialog = [=](const QString &msgSuffix = {}) {
|
||||
QStringList sl;
|
||||
@@ -637,7 +637,7 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
|
||||
openButton->deleteLater();
|
||||
};
|
||||
|
||||
connect(gitCloner, &QtcProcess::finished, [=] {
|
||||
connect(gitCloner, &QtcProcess::finished, this, [=] {
|
||||
openSslProgressDialog->close();
|
||||
validateOpenSsl();
|
||||
m_ui.openSslPathChooser->triggerChanged(); // After cloning, the path exists
|
||||
|
Reference in New Issue
Block a user