summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2010-09-03 18:19:03 +0300
committerOlli Salli <ollisal@gmail.com>2010-09-10 08:55:05 +0300
commiteb570459699001aa5d7cb75fecd7d071745cc575 (patch)
tree199bec40c404538ccf1be36c881661e53516a9c2
parentb5279f152b91a961fdba1486159cc9121df0502e (diff)
Make {Account,Connection}Factory::create() have a features param
-rw-r--r--TelepathyQt4/account-factory.cpp13
-rw-r--r--TelepathyQt4/account-factory.h6
-rw-r--r--TelepathyQt4/account-manager.cpp4
-rw-r--r--TelepathyQt4/account-manager.h2
-rw-r--r--TelepathyQt4/connection-factory.cpp9
-rw-r--r--TelepathyQt4/connection-factory.h4
6 files changed, 20 insertions, 18 deletions
diff --git a/TelepathyQt4/account-factory.cpp b/TelepathyQt4/account-factory.cpp
index 80d11339..3cdf6866 100644
--- a/TelepathyQt4/account-factory.cpp
+++ b/TelepathyQt4/account-factory.cpp
@@ -26,17 +26,10 @@
namespace Tp
{
-AccountFactoryPtr AccountFactory::create(const QDBusConnection &bus)
+AccountFactoryPtr AccountFactory::create(const QDBusConnection &bus, const Features &features)
{
- return AccountFactoryPtr(new AccountFactory(bus));
-}
-
-AccountFactoryPtr AccountFactory::coreFactory(const QDBusConnection &bus)
-{
- AccountFactoryPtr factory(create(bus));
-
- factory->addFeature(Account::FeatureCore);
-
+ AccountFactoryPtr factory(new AccountFactory(bus));
+ factory->addFeatures(features);
return factory;
}
diff --git a/TelepathyQt4/account-factory.h b/TelepathyQt4/account-factory.h
index 3b643331..5733ba63 100644
--- a/TelepathyQt4/account-factory.h
+++ b/TelepathyQt4/account-factory.h
@@ -30,6 +30,8 @@
#include <TelepathyQt4/SharedPtr>
#include <TelepathyQt4/Types>
+#include <TelepathyQt4/Account>
+#include <TelepathyQt4/Feature>
#include <TelepathyQt4/FixedFeatureFactory>
class QDBusConnection;
@@ -42,8 +44,8 @@ class PendingReady;
class TELEPATHY_QT4_EXPORT AccountFactory : public FixedFeatureFactory
{
public:
- static AccountFactoryPtr create(const QDBusConnection &bus);
- static AccountFactoryPtr coreFactory(const QDBusConnection &bus);
+ static AccountFactoryPtr create(const QDBusConnection &bus,
+ const Features &features = Features(Account::FeatureCore));
virtual ~AccountFactory();
diff --git a/TelepathyQt4/account-manager.cpp b/TelepathyQt4/account-manager.cpp
index 7fe08362..e852b6a7 100644
--- a/TelepathyQt4/account-manager.cpp
+++ b/TelepathyQt4/account-manager.cpp
@@ -364,7 +364,7 @@ AccountManager::AccountManager()
this,
ChannelFactory::stockFreshFactory(QDBusConnection::sessionBus()),
ConnectionFactory::create(QDBusConnection::sessionBus()),
- AccountFactory::coreFactory(QDBusConnection::sessionBus())))
+ AccountFactory::create(QDBusConnection::sessionBus())))
{
}
@@ -383,7 +383,7 @@ AccountManager::AccountManager(const QDBusConnection& bus)
this,
ChannelFactory::stockFreshFactory(bus),
ConnectionFactory::create(bus),
- AccountFactory::coreFactory(bus)))
+ AccountFactory::create(bus)))
{
}
diff --git a/TelepathyQt4/account-manager.h b/TelepathyQt4/account-manager.h
index 2e60a2ec..6eff2516 100644
--- a/TelepathyQt4/account-manager.h
+++ b/TelepathyQt4/account-manager.h
@@ -72,7 +72,7 @@ public:
const ConnectionFactoryConstPtr &connectionFactory =
ConnectionFactory::create(QDBusConnection::sessionBus()),
const AccountFactoryConstPtr &accountFactory =
- AccountFactory::coreFactory(QDBusConnection::sessionBus()),
+ AccountFactory::create(QDBusConnection::sessionBus()),
const QDBusConnection &bus =
QDBusConnection::sessionBus());
diff --git a/TelepathyQt4/connection-factory.cpp b/TelepathyQt4/connection-factory.cpp
index c7280bcc..383cee16 100644
--- a/TelepathyQt4/connection-factory.cpp
+++ b/TelepathyQt4/connection-factory.cpp
@@ -27,9 +27,14 @@
namespace Tp
{
-ConnectionFactoryPtr ConnectionFactory::create(const QDBusConnection &bus)
+ConnectionFactoryPtr ConnectionFactory::create(const QDBusConnection &bus,
+ const Features &features)
{
- return ConnectionFactoryPtr(new ConnectionFactory(bus));
+ ConnectionFactoryPtr factory(new ConnectionFactory(bus));
+
+ factory->addFeatures(features);
+
+ return factory;
}
ConnectionFactory::ConnectionFactory(const QDBusConnection &bus)
diff --git a/TelepathyQt4/connection-factory.h b/TelepathyQt4/connection-factory.h
index 0e9760e9..8296aab8 100644
--- a/TelepathyQt4/connection-factory.h
+++ b/TelepathyQt4/connection-factory.h
@@ -30,6 +30,7 @@
#include <TelepathyQt4/SharedPtr>
#include <TelepathyQt4/Types>
+#include <TelepathyQt4/Feature>
#include <TelepathyQt4/FixedFeatureFactory>
// For Q_DISABLE_COPY
@@ -47,7 +48,8 @@ class PendingReady;
class TELEPATHY_QT4_EXPORT ConnectionFactory : public FixedFeatureFactory
{
public:
- static ConnectionFactoryPtr create(const QDBusConnection &bus);
+ static ConnectionFactoryPtr create(const QDBusConnection &bus,
+ const Features &features = Features());
virtual ~ConnectionFactory();