Wizards: avoiding code duplication

I moved setPath(wizardDialogParameters.defaultPath()) into
the constructor of BaseProjectWizardDialog.

I created addExtensionPages() instead of having of having the
foreach everywhere. Moving the call into the constructor of
BaseProjectWizardDialog is not trivial since a lot of derived classes
rely on execution order and the order is often different.
Entangling this is not trivial and easily might break functionality.

Change-Id: I48dddaf72caea84da783dc9e2f42f2c7eff1c0ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Thomas Hartmann
2012-02-14 15:21:21 +01:00
parent c4b631f975
commit 0f073e4a35
20 changed files with 28 additions and 27 deletions

View File

@@ -61,8 +61,7 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const QString &templateName,
wizardProgress()->item(m_widgetPageId)->setTitle(tr("Custom Widgets"));
wizardProgress()->item(m_pluginPageId)->setTitle(tr("Plugin Details"));
foreach (QWizardPage *p, parameters.extensionPages())
Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p));
addExtensionPages(parameters.extensionPages());
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
}