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