[Telepathy-commits] [telepathy-salut/master] add salut_tube_stream_channel_get_allowed_properties accessor instead of having the array in the header
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Wed Mar 11 09:15:36 PDT 2009
---
src/salut-muc-manager.c | 4 ++--
src/salut-tubes-manager.c | 4 ++--
src/tube-stream.c | 12 ++++++++++++
src/tube-stream.h | 9 ++-------
4 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/src/salut-muc-manager.c b/src/salut-muc-manager.c
index 12a66d5..dca0251 100644
--- a/src/salut-muc-manager.c
+++ b/src/salut-muc-manager.c
@@ -378,7 +378,7 @@ salut_muc_manager_foreach_channel_class (TpChannelManager *manager,
/* org.freedesktop.Telepathy.Channel.Type.StreamTube */
g_value_set_static_string (channel_type_value,
SALUT_IFACE_CHANNEL_TYPE_STREAM_TUBE);
- func (manager, table, salut_stream_tube_channel_allowed_properties,
+ func (manager, table, salut_tube_stream_channel_get_allowed_properties (),
user_data);
g_hash_table_destroy (table);
@@ -813,7 +813,7 @@ salut_muc_manager_request (SalutMucManager *self,
if (tp_channel_manager_asv_has_unknown_properties (request_properties,
muc_tubes_channel_fixed_properties,
- salut_stream_tube_channel_allowed_properties,
+ salut_tube_stream_channel_get_allowed_properties (),
&error))
goto error;
diff --git a/src/salut-tubes-manager.c b/src/salut-tubes-manager.c
index 5742147..24cdf22 100644
--- a/src/salut-tubes-manager.c
+++ b/src/salut-tubes-manager.c
@@ -784,7 +784,7 @@ salut_tubes_manager_foreach_channel_class (
g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType",
value);
- func (manager, table, salut_stream_tube_channel_allowed_properties,
+ func (manager, table, salut_tube_stream_channel_get_allowed_properties (),
user_data);
g_hash_table_destroy (table);
@@ -853,7 +853,7 @@ salut_tubes_manager_requestotron (SalutTubesManager *self,
{
if (tp_channel_manager_asv_has_unknown_properties (request_properties,
tubes_channel_fixed_properties,
- salut_stream_tube_channel_allowed_properties,
+ salut_tube_stream_channel_get_allowed_properties (),
&error))
goto error;
diff --git a/src/tube-stream.c b/src/tube-stream.c
index 1508b41..cc9c601 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -92,6 +92,12 @@ static const gchar *salut_tube_stream_interfaces[] = {
NULL
};
+static const gchar * const salut_tube_stream_channel_allowed_properties[] = {
+ TP_IFACE_CHANNEL ".TargetHandle",
+ TP_IFACE_CHANNEL ".TargetID",
+ SALUT_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
+ NULL
+};
/* Linux glibc bits/socket.h suggests that struct sockaddr_storage is
* not guaranteed to be big enough for AF_UNIX addresses */
@@ -2508,6 +2514,12 @@ salut_tube_stream_offer (SalutTubeStream *self,
return TRUE;
}
+const gchar * const *
+salut_tube_stream_channel_get_allowed_properties (void)
+{
+ return salut_tube_stream_channel_allowed_properties;
+}
+
static void
tube_iface_init (gpointer g_iface,
gpointer iface_data)
diff --git a/src/tube-stream.h b/src/tube-stream.h
index 8a6c7f1..11dbc8b 100644
--- a/src/tube-stream.h
+++ b/src/tube-stream.h
@@ -48,13 +48,6 @@ struct _SalutTubeStream {
GType salut_tube_stream_get_type (void);
-static const gchar * const salut_stream_tube_channel_allowed_properties[] = {
- TP_IFACE_CHANNEL ".TargetHandle",
- TP_IFACE_CHANNEL ".TargetID",
- SALUT_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
- NULL
-};
-
/* TYPE MACROS */
#define SALUT_TYPE_TUBE_STREAM \
(salut_tube_stream_get_type ())
@@ -87,6 +80,8 @@ GHashTable * salut_tube_stream_get_supported_socket_types (void);
gboolean salut_tube_stream_offer (SalutTubeStream *self, GError **error);
+const gchar * const * salut_tube_stream_channel_get_allowed_properties (void);
+
G_END_DECLS
#endif /* #ifndef __SALUT_TUBE_STREAM_H__ */
--
1.5.6.5
More information about the telepathy-commits
mailing list