diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2012-02-14 15:21:21 +0100 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2012-02-15 10:56:54 +0100 |
commit | 0f073e4a35963d05727871a31898eaf6daf59dc8 (patch) | |
tree | 173179bf4cea1155759e007085092eb32f3e8251 /src/plugins/projectexplorer/baseprojectwizarddialog.cpp | |
parent | c4b631f97575cca5921a0c8645428354dbcf6745 (diff) | |
download | qt-creator-0f073e4a35963d05727871a31898eaf6daf59dc8.tar.gz |
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>
Diffstat (limited to 'src/plugins/projectexplorer/baseprojectwizarddialog.cpp')
-rw-r--r-- | src/plugins/projectexplorer/baseprojectwizarddialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp index 63e10ffe35..ac2acb5c16 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp @@ -72,6 +72,7 @@ BaseProjectWizardDialog::BaseProjectWizardDialog(QWidget *parent, Utils::Wizard(parent), d(new BaseProjectWizardDialogPrivate(new Utils::ProjectIntroPage)) { + setPath(parameters.defaultPath()); setSelectedPlatform(parameters.selectedPlatform()); setRequiredFeatures(parameters.requiredFeatures()); init(); @@ -84,6 +85,7 @@ BaseProjectWizardDialog::BaseProjectWizardDialog(Utils::ProjectIntroPage *introP Utils::Wizard(parent), d(new BaseProjectWizardDialogPrivate(introPage, introId)) { + setPath(parameters.defaultPath()); setSelectedPlatform(parameters.selectedPlatform()); setRequiredFeatures(parameters.requiredFeatures()); init(); @@ -171,6 +173,12 @@ QString BaseProjectWizardDialog::uniqueProjectName(const QString &path) return prefix; } +void BaseProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList) +{ + foreach (QWizardPage *p,wizardPageList) + Core::BaseFileWizard::applyExtensionPageShortTitle(this, addPage(p)); +} + QString BaseProjectWizardDialog::selectedPlatform() const { return d->selectedPlatform; |