From 2ae5ebdcc04b5c83b24e862c6e4ff466e5d08538 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 13 Jun 2025 15:21:05 +0200 Subject: [PATCH] Android: Don't copy gradle files into the project In seemingly random cases, the manifest/templates wizard copied the Gradle files into the project directory although the checkbox said not to do so. As fix, this change initializes the boolean of the wizard (to false) and sets the checked state in the wizard page based on that. Amends: 1daa7d34a2f94d939b652f8f5013f55e41d3c006 Task-number: QTCREATORBUG-26476 Change-Id: I5386644312bcee971d76b9e9230e1df20cd08446 Reviewed-by: Assam Boudjelthia --- src/plugins/android/manifestwizard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/manifestwizard.cpp b/src/plugins/android/manifestwizard.cpp index 4b5496e822c..e5dfdcd481e 100644 --- a/src/plugins/android/manifestwizard.cpp +++ b/src/plugins/android/manifestwizard.cpp @@ -64,7 +64,7 @@ private: BuildSystem *m_buildSystem; QString m_buildKey; FilePath m_directory; - bool m_copyGradleTemplates; + bool m_copyGradleTemplates = false; }; class NoApplicationTargetPage : public QWizardPage @@ -169,7 +169,7 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard) auto checkBox = new QCheckBox(this); connect(checkBox, &QCheckBox::toggled, wizard, &CreateAndroidManifestWizard::setCopyGradleTemplates); - checkBox->setChecked(false); + checkBox->setChecked(wizard->copyGradleTemplates()); checkBox->setText(Tr::tr("Copy the Gradle files to Android directory")); checkBox->setToolTip(Tr::tr("It is highly recommended if you are planning to extend " "the Java side of your Qt application."));