[empathy] empathy-auth-client: use a TpSimpleClientFactory
- From: Xavier Claessens <xclaesse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] empathy-auth-client: use a TpSimpleClientFactory
- Date: Fri, 4 Nov 2011 09:10:31 +0000 (UTC)
commit b9aad8c8792dfb03975feaec31bdc90d5157a9d2
Author: Xavier Claessens <xclaesse gmail com>
Date: Tue Oct 4 13:09:04 2011 +0200
empathy-auth-client: use a TpSimpleClientFactory
This prevent TpBaseClient to create a full TpAccountManager and allow
us to prepare TP_ACCOUNT_FEATURE_STORAGE feature on accounts
libempathy/empathy-auth-factory.c | 13 +++----------
libempathy/empathy-auth-factory.h | 2 +-
src/empathy-auth-client.c | 12 +++++++++++-
3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/libempathy/empathy-auth-factory.c b/libempathy/empathy-auth-factory.c
index 6368b1d..663dce0 100644
--- a/libempathy/empathy-auth-factory.c
+++ b/libempathy/empathy-auth-factory.c
@@ -565,19 +565,12 @@ empathy_auth_factory_class_init (EmpathyAuthFactoryClass *klass)
}
EmpathyAuthFactory *
-empathy_auth_factory_dup_singleton (void)
+empathy_auth_factory_new (TpSimpleClientFactory *factory)
{
- EmpathyAuthFactory *out = NULL;
- TpDBusDaemon *bus;
-
- bus = tp_dbus_daemon_dup (NULL);
- out = g_object_new (EMPATHY_TYPE_AUTH_FACTORY,
- "dbus-daemon", bus,
+ return g_object_new (EMPATHY_TYPE_AUTH_FACTORY,
+ "factory", factory,
"name", "Empathy.Auth",
NULL);
- g_object_unref (bus);
-
- return out;
}
gboolean
diff --git a/libempathy/empathy-auth-factory.h b/libempathy/empathy-auth-factory.h
index e9a670c..e84c13b 100644
--- a/libempathy/empathy-auth-factory.h
+++ b/libempathy/empathy-auth-factory.h
@@ -59,7 +59,7 @@ GType empathy_auth_factory_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_AUTH_FACTORY, \
EmpathyAuthFactoryClass))
-EmpathyAuthFactory * empathy_auth_factory_dup_singleton (void);
+EmpathyAuthFactory * empathy_auth_factory_new (TpSimpleClientFactory *factory);
gboolean empathy_auth_factory_register (EmpathyAuthFactory *self,
GError **error);
diff --git a/src/empathy-auth-client.c b/src/empathy-auth-client.c
index b7988e0..bb74468 100644
--- a/src/empathy-auth-client.c
+++ b/src/empathy-auth-client.c
@@ -243,6 +243,8 @@ main (int argc,
GError *error = NULL;
EmpathyAuthFactory *factory;
TpDebugSender *debug_sender;
+ TpSimpleClientFactory *tp_factory;
+ TpDBusDaemon *dbus;
g_thread_init (NULL);
@@ -276,7 +278,15 @@ main (int argc,
g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN);
#endif
- factory = empathy_auth_factory_dup_singleton ();
+ dbus = tp_dbus_daemon_dup (NULL);
+ tp_factory = tp_simple_client_factory_new (dbus);
+ tp_simple_client_factory_add_account_features_varargs (tp_factory,
+ TP_ACCOUNT_FEATURE_STORAGE,
+ 0);
+
+ factory = empathy_auth_factory_new (tp_factory);
+ g_object_unref (tp_factory);
+ g_object_unref (dbus);
g_signal_connect (factory, "new-server-tls-handler",
G_CALLBACK (auth_factory_new_tls_handler_cb), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]