Commit 0511ac5c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Rename ICustomWizardFactory to ICustomWizardMetaFactory



Also rename CustomWizardFactory to CustomWizardMetaFactory. These factories
are used to generate the actual factories that are visible in File->New, so
they are kind of Meta:-)

CustomWizardClassFactory was my first attempt, but since there are project-
and classwizards that are generated by this meta-factory that is not a good
name.

Get rid of a useless typedef while at it.

Change-Id: I3dc2cce3f52999af7e59d5f2ad5509153056ea49
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent afbb100c
...@@ -321,8 +321,8 @@ CustomWizard::CustomWizardContextPtr CustomWizard::context() const ...@@ -321,8 +321,8 @@ CustomWizard::CustomWizardContextPtr CustomWizard::context() const
CustomWizard *CustomWizard::createWizard(const CustomProjectWizard::CustomWizardParametersPtr &p) CustomWizard *CustomWizard::createWizard(const CustomProjectWizard::CustomWizardParametersPtr &p)
{ {
ICustomWizardFactory *factory = ExtensionSystem::PluginManager::getObject<ICustomWizardFactory>( ICustomWizardMetaFactory *factory = ExtensionSystem::PluginManager::getObject<ICustomWizardMetaFactory>(
[&p](ICustomWizardFactory *factory) { [&p](ICustomWizardMetaFactory *factory) {
return p->klass.isEmpty() ? (p->kind == factory->kind()) : (p->klass == factory->klass()); return p->klass.isEmpty() ? (p->kind == factory->kind()) : (p->klass == factory->klass());
}); });
......
...@@ -55,12 +55,12 @@ namespace Internal { ...@@ -55,12 +55,12 @@ namespace Internal {
} }
// Documentation inside. // Documentation inside.
class PROJECTEXPLORER_EXPORT ICustomWizardFactory : public QObject class PROJECTEXPLORER_EXPORT ICustomWizardMetaFactory : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
ICustomWizardFactory(const QString &klass, Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(const QString &klass, Core::IWizardFactory::WizardKind kind) :
m_klass(klass), m_kind(kind) m_klass(klass), m_kind(kind)
{ } { }
...@@ -74,11 +74,11 @@ private: ...@@ -74,11 +74,11 @@ private:
}; };
// Convenience template to create wizard factory classes. // Convenience template to create wizard factory classes.
template <class Wizard> class CustomWizardFactory : public ICustomWizardFactory template <class Wizard> class CustomWizardMetaFactory : public ICustomWizardMetaFactory
{ {
public: public:
CustomWizardFactory(const QString &klass, Core::IWizardFactory::WizardKind kind) : ICustomWizardFactory(klass, kind) { } CustomWizardMetaFactory(const QString &klass, Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(klass, kind) { }
CustomWizardFactory(Core::IWizardFactory::WizardKind kind) : ICustomWizardFactory(QString(), kind) { } CustomWizardMetaFactory(Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(QString(), kind) { }
CustomWizard *create() const { return new Wizard; } CustomWizard *create() const { return new Wizard; }
}; };
...@@ -89,7 +89,6 @@ class PROJECTEXPLORER_EXPORT CustomWizard : public Core::BaseFileWizardFactory ...@@ -89,7 +89,6 @@ class PROJECTEXPLORER_EXPORT CustomWizard : public Core::BaseFileWizardFactory
public: public:
typedef QMap<QString, QString> FieldReplacementMap; typedef QMap<QString, QString> FieldReplacementMap;
typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr;
CustomWizard(); CustomWizard();
~CustomWizard(); ~CustomWizard();
......
...@@ -398,9 +398,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er ...@@ -398,9 +398,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(sessionManager, SIGNAL(sessionLoaded(QString)), connect(sessionManager, SIGNAL(sessionLoaded(QString)),
this, SLOT(updateWelcomePage())); this, SLOT(updateWelcomePage()));
addAutoReleasedObject(new CustomWizardFactory<CustomProjectWizard>(Core::IWizardFactory::ProjectWizard)); addAutoReleasedObject(new CustomWizardMetaFactory<CustomProjectWizard>(Core::IWizardFactory::ProjectWizard));
addAutoReleasedObject(new CustomWizardFactory<CustomWizard>(Core::IWizardFactory::FileWizard)); addAutoReleasedObject(new CustomWizardMetaFactory<CustomWizard>(Core::IWizardFactory::FileWizard));
addAutoReleasedObject(new CustomWizardFactory<CustomWizard>(Core::IWizardFactory::ClassWizard)); addAutoReleasedObject(new CustomWizardMetaFactory<CustomWizard>(Core::IWizardFactory::ClassWizard));
d->m_proWindow = new ProjectWindow; d->m_proWindow = new ProjectWindow;
addAutoReleasedObject(d->m_proWindow); addAutoReleasedObject(d->m_proWindow);
......
...@@ -125,7 +125,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString ...@@ -125,7 +125,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
addAutoReleasedObject(new TestWizard); addAutoReleasedObject(new TestWizard);
addAutoReleasedObject(new CustomWidgetWizard); addAutoReleasedObject(new CustomWidgetWizard);
addAutoReleasedObject(new CustomWizardFactory<CustomQmakeProjectWizard> addAutoReleasedObject(new CustomWizardMetaFactory<CustomQmakeProjectWizard>
(QLatin1String("qmakeproject"), Core::IWizardFactory::ProjectWizard)); (QLatin1String("qmakeproject"), Core::IWizardFactory::ProjectWizard));
addAutoReleasedObject(new QMakeStepFactory); addAutoReleasedObject(new QMakeStepFactory);
......
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