summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2015-12-01 12:43:33 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2015-12-01 14:24:01 +0000
commitbb2e5c6ec62f9bc23cea2c67f129fe1f7873b1be (patch)
tree2f827357ab02aa898b5ab2c3ebfcc08b14d83cc7
parent0e2bb7e307d3f75b903998af1813a0f590e144bc (diff)
Remove unused code from QAspectFactory
Change-Id: I1639a3ee2e4aac177f1c7cf4252a1c65db7cf721 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/core/aspects/qaspectfactory.cpp5
-rw-r--r--src/core/aspects/qaspectfactory_p.h8
-rw-r--r--tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp21
3 files changed, 0 insertions, 34 deletions
diff --git a/src/core/aspects/qaspectfactory.cpp b/src/core/aspects/qaspectfactory.cpp
index 416aa2563..faa946ec9 100644
--- a/src/core/aspects/qaspectfactory.cpp
+++ b/src/core/aspects/qaspectfactory.cpp
@@ -73,11 +73,6 @@ QAspectFactory &QAspectFactory::operator=(const QAspectFactory &other)
return *this;
}
-void QAspectFactory::addFactory(const QString &name, QAspectFactory::CreateFunction factory)
-{
- m_factories.insert(name, factory);
-}
-
QStringList QAspectFactory::availableFactories() const
{
return m_factories.keys();
diff --git a/src/core/aspects/qaspectfactory_p.h b/src/core/aspects/qaspectfactory_p.h
index 6bbdc3dbe..f42010d1a 100644
--- a/src/core/aspects/qaspectfactory_p.h
+++ b/src/core/aspects/qaspectfactory_p.h
@@ -66,12 +66,6 @@ class QT3DCORE_PRIVATE_EXPORT QAspectFactory
public:
typedef QAbstractAspect *(*CreateFunction)(QObject *);
- template<class AspectType>
- static QAbstractAspect *functionHelper(QObject *parent)
- {
- return new AspectType(parent);
- }
-
QAspectFactory();
QAspectFactory(const QAspectFactory &other);
~QAspectFactory();
@@ -86,9 +80,7 @@ public:
inline void swap(QAspectFactory &other) Q_DECL_NOTHROW { m_factories.swap(other.m_factories); }
- void addFactory(const QString &name, CreateFunction factory);
QStringList availableFactories() const;
-
QAbstractAspect *createAspect(const QString &aspect, QObject *parent = 0) const;
private:
diff --git a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp
index 371c54e41..11e5deaa0 100644
--- a/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp
+++ b/tests/auto/core/qaspectfactory/tst_qaspectfactory.cpp
@@ -89,27 +89,6 @@ private Q_SLOTS:
QVERIFY(aspect->parent() == Q_NULLPTR);
}
- void shouldRegisterFactories()
- {
- // GIVEN
- QAspectFactory factory;
-
- // WHEN
- factory.addFactory(QStringLiteral("another"),
- QAspectFactory::functionHelper<AnotherFakeAspect>);
-
- // THEN
- QCOMPARE(factory.availableFactories().size(), 2);
- QVERIFY(factory.availableFactories().contains(QStringLiteral("another")));
-
- // WHEN
- QAbstractAspect *aspect = factory.createAspect(QStringLiteral("another"), this);
-
- // THEN
- QVERIFY(qobject_cast<AnotherFakeAspect*>(aspect) != Q_NULLPTR);
- QCOMPARE(aspect->parent(), this);
- }
-
void shouldGracefulyHandleMissingFactories()
{
// GIVEN