From b35ddc57edcbec0a8c9ba21e6394f1fedd3fc914 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 30 May 2014 11:08:41 +0200 Subject: Inline CustomWizard::initWizardDialog() It is used only once, so get rid of that indirection. Change-Id: I017abe58cdcdcc7f8b6c6c1c81296a7ef4cd81cd Reviewed-by: Orgad Shaneh --- .../projectexplorer/customwizard/customwizard.cpp | 17 +++++------------ src/plugins/projectexplorer/customwizard/customwizard.h | 3 --- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/plugins/projectexplorer/customwizard/customwizard.cpp b/src/plugins/projectexplorer/customwizard/customwizard.cpp index dbf0fd7ffd..723542be81 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizard.cpp @@ -134,29 +134,22 @@ static inline void addWizardPage(Utils::Wizard *w, QWizardPage *p, int id) w->wizardProgress()->item(addedPageId)->setTitle(QCoreApplication::translate("ProjectExplorer::CustomWizard", "Details", "Default short title for custom wizard page to be shown in the progress pane of the wizard.")); } -// Initialize a wizard with a custom file page. -void CustomWizard::initWizardDialog(Core::BaseFileWizard *wizard, const QString &defaultPath, - const WizardPageList &extensionPages) const +Core::BaseFileWizard *CustomWizard::create(QWidget *parent, const Core::WizardDialogParameters &p) const { - QTC_ASSERT(!parameters().isNull(), return); + QTC_ASSERT(!d->m_parameters.isNull(), return 0); + Core::BaseFileWizard *wizard = new Core::BaseFileWizard(parent); d->m_context->reset(); Internal::CustomWizardPage *customPage = new Internal::CustomWizardPage(d->m_context, parameters()); - customPage->setPath(defaultPath); + customPage->setPath(p.defaultPath()); addWizardPage(wizard, customPage, parameters()->firstPageId); if (!parameters()->fieldPageTitle.isEmpty()) customPage->setTitle(parameters()->fieldPageTitle); - foreach (QWizardPage *ep, extensionPages) + foreach (QWizardPage *ep, p.extensionPages()) BaseFileWizardFactory::applyExtensionPageShortTitle(wizard, wizard->addPage(ep)); if (CustomWizardPrivate::verbose) qDebug() << "initWizardDialog" << wizard << wizard->pageIds(); -} -Core::BaseFileWizard *CustomWizard::create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const -{ - QTC_ASSERT(!d->m_parameters.isNull(), return 0); - Core::BaseFileWizard *wizard = new Core::BaseFileWizard(parent); - initWizardDialog(wizard, parameters.defaultPath(), parameters.extensionPages()); return wizard; } diff --git a/src/plugins/projectexplorer/customwizard/customwizard.h b/src/plugins/projectexplorer/customwizard/customwizard.h index 2d8609158d..733abd5aae 100644 --- a/src/plugins/projectexplorer/customwizard/customwizard.h +++ b/src/plugins/projectexplorer/customwizard/customwizard.h @@ -111,9 +111,6 @@ protected: typedef QSharedPointer CustomWizardParametersPtr; typedef QSharedPointer CustomWizardContextPtr; - void initWizardDialog(Core::BaseFileWizard *w, const QString &defaultPath, - const WizardPageList &extensionPages) const; - // generate files in path Core::GeneratedFiles generateWizardFiles(QString *errorMessage) const; // Create replacement map as static base fields + QWizard fields -- cgit v1.2.1