forked from qt-creator/qt-creator
BaseFileWizard: Rename selectExtensions method
Rename selectExtensions method of BaseFileWizard to extensions and fix the fallout. Mark the method as const while at it. Change-Id: I716988fec464e06df6b128e4b3754164e61cd7a1 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -175,7 +175,7 @@ void WizardEventLoop::rejected()
|
||||
\sa Core::Internal::WizardEventLoop
|
||||
*/
|
||||
|
||||
BaseFileWizard::ExtensionList BaseFileWizard::selectExtensions()
|
||||
BaseFileWizard::ExtensionList BaseFileWizard::extensions() const
|
||||
{
|
||||
return ExtensionSystem::PluginManager::getObjects<IFileWizardExtension>();
|
||||
}
|
||||
@@ -186,12 +186,12 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
|
||||
|
||||
QString errorMessage;
|
||||
// Compile extension pages, purge out unused ones
|
||||
ExtensionList extensions = selectExtensions();
|
||||
ExtensionList extensionList = extensions();
|
||||
WizardPageList allExtensionPages;
|
||||
for (ExtensionList::iterator it = extensions.begin(); it != extensions.end(); ) {
|
||||
for (ExtensionList::iterator it = extensionList.begin(); it != extensionList.end(); ) {
|
||||
const WizardPageList extensionPages = (*it)->extensionPages(this);
|
||||
if (extensionPages.empty()) {
|
||||
it = extensions.erase(it);
|
||||
it = extensionList.erase(it);
|
||||
} else {
|
||||
allExtensionPages += extensionPages;
|
||||
++it;
|
||||
@@ -199,7 +199,7 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
|
||||
}
|
||||
|
||||
if (debugWizard)
|
||||
qDebug() << Q_FUNC_INFO << path << parent << "exs" << extensions.size() << allExtensionPages.size();
|
||||
qDebug() << Q_FUNC_INFO << path << parent << "exs" << extensionList.size() << allExtensionPages.size();
|
||||
|
||||
QWizardPage *firstExtensionPage = 0;
|
||||
if (!allExtensionPages.empty())
|
||||
@@ -244,7 +244,7 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
|
||||
}
|
||||
}
|
||||
if (firstExtensionPageHit)
|
||||
foreach (IFileWizardExtension *ex, extensions)
|
||||
foreach (IFileWizardExtension *ex, extensionList)
|
||||
ex->firstExtensionPageShown(files, extraValues);
|
||||
if (accepted)
|
||||
break;
|
||||
@@ -262,7 +262,7 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (IFileWizardExtension *ex, extensions) {
|
||||
foreach (IFileWizardExtension *ex, extensionList) {
|
||||
for (int i = 0; i < files.count(); i++) {
|
||||
ex->applyCodeStyle(&files[i]);
|
||||
}
|
||||
@@ -276,7 +276,7 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
|
||||
|
||||
bool removeOpenProjectAttribute = false;
|
||||
// Run the extensions
|
||||
foreach (IFileWizardExtension *ex, extensions) {
|
||||
foreach (IFileWizardExtension *ex, extensionList) {
|
||||
bool remove;
|
||||
if (!ex->processFiles(files, &remove, &errorMessage)) {
|
||||
if (!errorMessage.isEmpty())
|
||||
|
@@ -118,7 +118,7 @@ protected:
|
||||
typedef QList<QWizardPage *> WizardPageList;
|
||||
typedef QList<Core::IFileWizardExtension*> ExtensionList;
|
||||
|
||||
virtual ExtensionList selectExtensions();
|
||||
virtual ExtensionList extensions() const;
|
||||
|
||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||
const WizardDialogParameters &wizardDialogParameters) const = 0;
|
||||
|
@@ -124,7 +124,7 @@ CascadesImportWizard::CascadesImportWizard()
|
||||
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
||||
}
|
||||
|
||||
Core::BaseFileWizard::ExtensionList CascadesImportWizard::selectExtensions()
|
||||
Core::BaseFileWizard::ExtensionList CascadesImportWizard::extensions() const
|
||||
{
|
||||
return Core::BaseFileWizard::ExtensionList();
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
CascadesImportWizard();
|
||||
|
||||
protected:
|
||||
ExtensionList selectExtensions();
|
||||
ExtensionList extensions() const;
|
||||
QWizard* createWizardDialog(QWidget *parent,
|
||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||
|
Reference in New Issue
Block a user