[Telepathy-commits] [telepathy-gabble/master] add gabble_tube_stream_channel_get_allowed_properties function instead of defining the array in the header file
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Thu Feb 5 05:55:59 PST 2009
---
src/muc-factory.c | 4 ++--
src/private-tubes-factory.c | 6 +++---
src/tube-stream.c | 14 ++++++++++++++
src/tube-stream.h | 10 ++--------
4 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/src/muc-factory.c b/src/muc-factory.c
index 9d935fa..77cb987 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -1383,7 +1383,7 @@ gabble_muc_factory_foreach_channel_class (TpChannelManager *manager,
/* Muc Channel.Type.StreamTube */
g_value_set_static_string (channel_type_value,
GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE);
- func (manager, table, gabble_tube_stream_channel_allowed_properties,
+ func (manager, table, gabble_tube_stream_channel_get_allowed_properties (),
user_data);
/* Muc Channel.Type.DBusTube */
@@ -1595,7 +1595,7 @@ handle_stream_tube_channel_request (GabbleMucFactory *self,
if (tp_channel_manager_asv_has_unknown_properties (request_properties,
muc_tubes_channel_fixed_properties,
- gabble_tube_stream_channel_allowed_properties,
+ gabble_tube_stream_channel_get_allowed_properties (),
error))
return FALSE;
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index c04f80f..54fb9ce 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -510,7 +510,7 @@ add_generic_tube_caps (GPtrArray *arr)
dbus_g_type_struct_set (&monster1,
0, fixed_properties,
- 1, gabble_tube_stream_channel_allowed_properties,
+ 1, gabble_tube_stream_channel_get_allowed_properties (),
G_MAXUINT);
g_hash_table_destroy (fixed_properties);
@@ -1118,7 +1118,7 @@ gabble_private_tubes_factory_foreach_channel_class (
g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType",
value);
- func (manager, table, gabble_tube_stream_channel_allowed_properties,
+ func (manager, table, gabble_tube_stream_channel_get_allowed_properties (),
user_data);
g_hash_table_destroy (table);
@@ -1182,7 +1182,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
if (tp_channel_manager_asv_has_unknown_properties (request_properties,
tubes_channel_fixed_properties,
- gabble_tube_stream_channel_allowed_properties,
+ gabble_tube_stream_channel_get_allowed_properties (),
&error))
goto error;
diff --git a/src/tube-stream.c b/src/tube-stream.c
index 0cf6e58..45dd92f 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -81,6 +81,14 @@ G_DEFINE_TYPE_WITH_CODE (GabbleTubeStream, gabble_tube_stream, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL));
+static const gchar * const gabble_tube_stream_channel_allowed_properties[] = {
+ TP_IFACE_CHANNEL ".TargetHandle",
+ TP_IFACE_CHANNEL ".TargetID",
+ GABBLE_IFACE_CHANNEL_INTERFACE_TUBE ".Parameters",
+ GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
+ NULL
+};
+
static const gchar *gabble_tube_stream_interfaces[] = {
TP_IFACE_CHANNEL_INTERFACE_GROUP,
/* If more interfaces are added, either keep Group as the first, or change
@@ -2128,6 +2136,12 @@ gabble_tube_stream_get_interfaces (TpSvcChannel *iface,
}
}
+const gchar * const *
+gabble_tube_stream_channel_get_allowed_properties (void)
+{
+ return gabble_tube_stream_channel_allowed_properties;
+}
+
static void
channel_iface_init (gpointer g_iface,
gpointer iface_data)
diff --git a/src/tube-stream.h b/src/tube-stream.h
index 8790864..dfaebfb 100644
--- a/src/tube-stream.h
+++ b/src/tube-stream.h
@@ -64,14 +64,6 @@ GType gabble_tube_stream_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_TUBE_STREAM,\
GabbleTubeStreamClass))
-static const gchar * const gabble_tube_stream_channel_allowed_properties[] = {
- TP_IFACE_CHANNEL ".TargetHandle",
- TP_IFACE_CHANNEL ".TargetID",
- GABBLE_IFACE_CHANNEL_INTERFACE_TUBE ".Parameters",
- GABBLE_IFACE_CHANNEL_TYPE_STREAM_TUBE ".Service",
- NULL
-};
-
GabbleTubeStream *gabble_tube_stream_new (GabbleConnection *conn,
TpHandle handle, TpHandleType handle_type, TpHandle self_handle,
TpHandle initiator, const gchar *service, GHashTable *parameters,
@@ -85,6 +77,8 @@ gboolean gabble_tube_stream_offer (GabbleTubeStream *self, GError **error);
GHashTable *gabble_tube_stream_get_supported_socket_types (void);
+const gchar * const * gabble_tube_stream_channel_get_allowed_properties (void);
+
G_END_DECLS
#endif /* #ifndef __GABBLE_TUBE_STREAM_H__ */
--
1.5.6.5
More information about the telepathy-commits
mailing list