summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-05-30 11:08:41 +0200
committerTobias Hunger <tobias.hunger@digia.com>2014-06-06 09:36:16 +0200
commitb35ddc57edcbec0a8c9ba21e6394f1fedd3fc914 (patch)
treeef52ab898e86f240f6df59a1e762d9ff5683cff4
parenta231e03ba80891d4fbe774a6148c21f7a24e69d9 (diff)
downloadqt-creator-b35ddc57edcbec0a8c9ba21e6394f1fedd3fc914.tar.gz
Inline CustomWizard::initWizardDialog()
It is used only once, so get rid of that indirection. Change-Id: I017abe58cdcdcc7f8b6c6c1c81296a7ef4cd81cd Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r--src/plugins/projectexplorer/customwizard/customwizard.cpp17
-rw-r--r--src/plugins/projectexplorer/customwizard/customwizard.h3
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 &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;
}
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<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