[Telepathy-commits] [telepathy-gabble/master] add gabble_tube_dbus_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:52:01 PST 2009
---
src/muc-factory.c | 4 ++--
src/private-tubes-factory.c | 7 ++++---
src/tube-dbus.c | 14 ++++++++++++++
src/tube-dbus.h | 10 ++--------
4 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/src/muc-factory.c b/src/muc-factory.c
index e012d66..9d935fa 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -1389,7 +1389,7 @@ gabble_muc_factory_foreach_channel_class (TpChannelManager *manager,
/* Muc Channel.Type.DBusTube */
g_value_set_static_string (channel_type_value,
GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE);
- func (manager, table, gabble_tube_dbus_channel_allowed_properties,
+ func (manager, table, gabble_tube_dbus_channel_get_allowed_properties (),
user_data);
g_hash_table_destroy (table);
@@ -1626,7 +1626,7 @@ handle_dbus_tube_channel_request (GabbleMucFactory *self,
if (tp_channel_manager_asv_has_unknown_properties (request_properties,
muc_tubes_channel_fixed_properties,
- gabble_tube_dbus_channel_allowed_properties,
+ gabble_tube_dbus_channel_get_allowed_properties (),
error))
return FALSE;
diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index cf169f4..c04f80f 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -539,7 +539,7 @@ add_generic_tube_caps (GPtrArray *arr)
dbus_g_type_struct_set (&monster2,
0, fixed_properties,
- 1, gabble_tube_dbus_channel_allowed_properties,
+ 1, gabble_tube_dbus_channel_get_allowed_properties (),
G_MAXUINT);
g_hash_table_destroy (fixed_properties);
@@ -1137,7 +1137,8 @@ gabble_private_tubes_factory_foreach_channel_class (
g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType",
value);
- func (manager, table, gabble_tube_dbus_channel_allowed_properties, user_data);
+ func (manager, table, gabble_tube_dbus_channel_get_allowed_properties (),
+ user_data);
g_hash_table_destroy (table);
}
@@ -1203,7 +1204,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self,
if (tp_channel_manager_asv_has_unknown_properties (request_properties,
tubes_channel_fixed_properties,
- gabble_tube_dbus_channel_allowed_properties,
+ gabble_tube_dbus_channel_get_allowed_properties (),
&error))
goto error;
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index b650e37..bc3fbb2 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -90,6 +90,14 @@ static const gchar *gabble_tube_dbus_interfaces[] = {
NULL
};
+const gchar * const gabble_tube_dbus_channel_allowed_properties[] = {
+ TP_IFACE_CHANNEL ".TargetHandle",
+ TP_IFACE_CHANNEL ".TargetID",
+ GABBLE_IFACE_CHANNEL_INTERFACE_TUBE ".Parameters",
+ GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName",
+ NULL
+};
+
/* signals */
enum
{
@@ -1892,6 +1900,12 @@ gabble_tube_dbus_accept_d_bus_tube (GabbleSvcChannelTypeDBusTube *self,
}
}
+const gchar * const *
+gabble_tube_dbus_channel_get_allowed_properties (void)
+{
+ return gabble_tube_dbus_channel_allowed_properties;
+}
+
static void
channel_iface_init (gpointer g_iface,
gpointer iface_data)
diff --git a/src/tube-dbus.h b/src/tube-dbus.h
index 9fbefd5..a2f4ef8 100644
--- a/src/tube-dbus.h
+++ b/src/tube-dbus.h
@@ -69,14 +69,6 @@ GType gabble_tube_dbus_get_type (void);
(G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_TUBE_DBUS,\
GabbleTubeDBusClass))
-static const gchar * const gabble_tube_dbus_channel_allowed_properties[] = {
- TP_IFACE_CHANNEL ".TargetHandle",
- TP_IFACE_CHANNEL ".TargetID",
- GABBLE_IFACE_CHANNEL_INTERFACE_TUBE ".Parameters",
- GABBLE_IFACE_CHANNEL_TYPE_DBUS_TUBE ".ServiceName",
- NULL
-};
-
GabbleTubeDBus *gabble_tube_dbus_new (GabbleConnection *conn, TpHandle handle,
TpHandleType handle_type, TpHandle self_handle, TpHandle initiator,
const gchar *service, GHashTable *parameters, const gchar *stream_id,
@@ -92,6 +84,8 @@ gboolean gabble_tube_dbus_handle_in_names (GabbleTubeDBus *tube,
gboolean gabble_tube_dbus_offer (GabbleTubeDBus *tube, GError **error);
+const gchar * const * gabble_tube_dbus_channel_get_allowed_properties (void);
+
/* Only extern for the benefit of tests/test-dtube-unique-names.c */
gchar *_gabble_generate_dbus_unique_name (const gchar *nick);
--
1.5.6.5
More information about the telepathy-commits
mailing list