Wizards: Speed up JsonSummaryPage::initialize()

The summarySettingsHaveChanged() slot takes a (too?) long time, so at
least make sure we don't call it repeatedly while setting up the page.

Task-number: QTCREATORBUG-29290
Change-Id: Id010c41739a1381212731bb7638d6db87081c3b6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2023-06-20 17:13:51 +02:00
parent 456a019f2d
commit 29ade7d682

View File

@@ -298,10 +298,6 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent)
scrollArea, scrollArea,
}.attachTo(this); }.attachTo(this);
connect(m_projectComboBox, &QComboBox::currentIndexChanged,
this, &ProjectWizardPage::projectChanged);
connect(m_addToVersionControlComboBox, &QComboBox::currentIndexChanged,
this, &ProjectWizardPage::versionControlChanged);
connect(m_vcsManageButton, &QAbstractButton::clicked, this, &ProjectWizardPage::manageVcs); connect(m_vcsManageButton, &QAbstractButton::clicked, this, &ProjectWizardPage::manageVcs);
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary")); setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
@@ -376,6 +372,7 @@ void ProjectWizardPage::initializeVersionControls()
// 2) Directory is managed and VCS does not support "Add" -> None available // 2) Directory is managed and VCS does not support "Add" -> None available
// 3) Directory is not managed -> Offer all VCS that support "CreateRepository" // 3) Directory is not managed -> Offer all VCS that support "CreateRepository"
m_addToVersionControlComboBox->disconnect();
QList<IVersionControl *> versionControls = VcsManager::versionControls(); QList<IVersionControl *> versionControls = VcsManager::versionControls();
if (versionControls.isEmpty()) if (versionControls.isEmpty())
hideVersionControlUiElements(); hideVersionControlUiElements();
@@ -419,6 +416,9 @@ void ProjectWizardPage::initializeVersionControls()
int newIdx = m_activeVersionControls.indexOf(currentSelection) + 1; int newIdx = m_activeVersionControls.indexOf(currentSelection) + 1;
setVersionControlIndex(newIdx); setVersionControlIndex(newIdx);
} }
connect(m_addToVersionControlComboBox, &QComboBox::currentIndexChanged,
this, &ProjectWizardPage::versionControlChanged);
} }
bool ProjectWizardPage::runVersionControl(const QList<GeneratedFile> &files, QString *errorMessage) bool ProjectWizardPage::runVersionControl(const QList<GeneratedFile> &files, QString *errorMessage)
@@ -457,6 +457,7 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const FilePaths &pa
IWizardFactory::WizardKind kind, IWizardFactory::WizardKind kind,
ProjectAction action) ProjectAction action)
{ {
m_projectComboBox->disconnect();
BestNodeSelector selector(m_commonDirectory, paths); BestNodeSelector selector(m_commonDirectory, paths);
TreeItem *root = m_model.rootItem(); TreeItem *root = m_model.rootItem();
@@ -489,6 +490,8 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const FilePaths &pa
setAddingSubProject(action == AddSubProject); setAddingSubProject(action == AddSubProject);
m_projectComboBox->setEnabled(m_model.rowCount(QModelIndex()) > 1); m_projectComboBox->setEnabled(m_model.rowCount(QModelIndex()) > 1);
connect(m_projectComboBox, &QComboBox::currentIndexChanged,
this, &ProjectWizardPage::projectChanged);
} }
void ProjectWizardPage::setNoneLabel(const QString &label) void ProjectWizardPage::setNoneLabel(const QString &label)