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: 1daa7d34a2

Task-number: QTCREATORBUG-26476
Change-Id: I5386644312bcee971d76b9e9230e1df20cd08446
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Alessandro Portale
2025-06-13 15:21:05 +02:00
parent 288e374ff6
commit 2ae5ebdcc0

View File

@@ -64,7 +64,7 @@ private:
BuildSystem *m_buildSystem; BuildSystem *m_buildSystem;
QString m_buildKey; QString m_buildKey;
FilePath m_directory; FilePath m_directory;
bool m_copyGradleTemplates; bool m_copyGradleTemplates = false;
}; };
class NoApplicationTargetPage : public QWizardPage class NoApplicationTargetPage : public QWizardPage
@@ -169,7 +169,7 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
auto checkBox = new QCheckBox(this); auto checkBox = new QCheckBox(this);
connect(checkBox, &QCheckBox::toggled, connect(checkBox, &QCheckBox::toggled,
wizard, &CreateAndroidManifestWizard::setCopyGradleTemplates); wizard, &CreateAndroidManifestWizard::setCopyGradleTemplates);
checkBox->setChecked(false); checkBox->setChecked(wizard->copyGradleTemplates());
checkBox->setText(Tr::tr("Copy the Gradle files to Android directory")); 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 " checkBox->setToolTip(Tr::tr("It is highly recommended if you are planning to extend "
"the Java side of your Qt application.")); "the Java side of your Qt application."));