Commit b35ddc57 authored by Tobias Hunger's avatar Tobias Hunger

Inline CustomWizard::initWizardDialog()

It is used only once, so get rid of that indirection.

Change-Id: I017abe58cdcdcc7f8b6c6c1c81296a7ef4cd81cd
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent a231e03b
......@@ -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 &parameters) const
{
QTC_ASSERT(!d->m_parameters.isNull(), return 0);
Core::BaseFileWizard *wizard = new Core::BaseFileWizard(parent);
initWizardDialog(wizard, parameters.defaultPath(), parameters.extensionPages());
return wizard;
}
......
......@@ -111,9 +111,6 @@ protected:
typedef QSharedPointer<Internal::CustomWizardParameters> CustomWizardParametersPtr;
typedef QSharedPointer<Internal::CustomWizardContext> 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment