[Telepathy-commits] [telepathy-gabble/master] add gabble_connection_manager_get_protocols() instead of having gabble_protocols extern

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Mar 26 09:30:10 PDT 2009


---
 src/connection-manager.c |    8 +++++++-
 src/connection-manager.h |    4 ++--
 src/write-mgr-file.c     |    3 ++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/connection-manager.c b/src/connection-manager.c
index 0721f85..d41c165 100644
--- a/src/connection-manager.c
+++ b/src/connection-manager.c
@@ -53,7 +53,7 @@ gabble_connection_manager_class_init (GabbleConnectionManagerClass *klass)
 
   base_class->new_connection = _gabble_connection_manager_new_connection;
   base_class->cm_dbus_name = "gabble";
-  base_class->protocol_params = gabble_protocols;
+  base_class->protocol_params = gabble_connection_manager_get_protocols ();
 }
 
 /* private data */
@@ -228,6 +228,12 @@ const TpCMProtocolSpec gabble_protocols[] = {
   { NULL, NULL }
 };
 
+const TpCMProtocolSpec *
+gabble_connection_manager_get_protocols (void)
+{
+  return gabble_protocols;
+}
+
 #define SET_PROPERTY_IF_PARAM_SET(prop, param, member) \
   if (tp_intset_is_member (params_present, param)) \
     { \
diff --git a/src/connection-manager.h b/src/connection-manager.h
index 63af0a8..4ef7735 100644
--- a/src/connection-manager.h
+++ b/src/connection-manager.h
@@ -40,8 +40,6 @@ struct _GabbleConnectionManager {
     GabbleConnectionManagerPrivate *priv;
 };
 
-extern const TpCMProtocolSpec gabble_protocols[];
-
 GType gabble_connection_manager_get_type (void);
 
 /* TYPE MACROS */
@@ -61,6 +59,8 @@ GType gabble_connection_manager_get_type (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_CONNECTION_MANAGER, \
                               GabbleConnectionManagerClass))
 
+const TpCMProtocolSpec * gabble_connection_manager_get_protocols (void);
+
 G_END_DECLS
 
 #endif /* #ifndef __GABBLE_CONNECTION_MANAGER_H__*/
diff --git a/src/write-mgr-file.c b/src/write-mgr-file.c
index a0179d5..e4c8ab9 100644
--- a/src/write-mgr-file.c
+++ b/src/write-mgr-file.c
@@ -92,7 +92,8 @@ main (void)
 
   gchar *s = mgr_file_contents (TP_CM_BUS_NAME_BASE "gabble",
                                TP_CM_OBJECT_PATH_BASE "gabble",
-                               gabble_protocols, &error);
+                               gabble_connection_manager_get_protocols (),
+                               &error);
   if (!s)
     {
       fprintf (stderr, "%s", error->message);
-- 
1.5.6.5



More information about the telepathy-commits mailing list