[Telepathy-commits] [telepathy-salut/master] GibberBytestream{Direct, OOB}: add a comment on set_transport
Alban Crequy
alban.crequy at collabora.co.uk
Mon Dec 1 08:52:03 PST 2008
---
lib/gibber/gibber-bytestream-direct.c | 11 +++++++----
lib/gibber/gibber-bytestream-oob.c | 3 +++
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/lib/gibber/gibber-bytestream-direct.c b/lib/gibber/gibber-bytestream-direct.c
index b74ee8f..d222e04 100644
--- a/lib/gibber/gibber-bytestream-direct.c
+++ b/lib/gibber/gibber-bytestream-direct.c
@@ -470,11 +470,14 @@ set_transport (GibberBytestreamDirect *self,
priv->transport = g_object_ref (transport);
gibber_transport_set_handler (transport, transport_handler, self);
+ /* The transport will already be connected if it is created from
+ * GibberListener. In this case, set the bytestream to open, otherwise
+ * it will be done in transport_connected_cb. */
if (gibber_transport_get_state (transport) == GIBBER_TRANSPORT_CONNECTED)
- {
- g_object_set (self, "state", GIBBER_BYTESTREAM_STATE_OPEN,
- NULL);
- }
+ {
+ g_object_set (self, "state", GIBBER_BYTESTREAM_STATE_OPEN,
+ NULL);
+ }
g_signal_connect (transport, "connected",
G_CALLBACK (transport_connected_cb), self);
diff --git a/lib/gibber/gibber-bytestream-oob.c b/lib/gibber/gibber-bytestream-oob.c
index 82358aa..f0d5723 100644
--- a/lib/gibber/gibber-bytestream-oob.c
+++ b/lib/gibber/gibber-bytestream-oob.c
@@ -230,6 +230,9 @@ set_transport (GibberBytestreamOOB *self,
priv->transport = g_object_ref (transport);
gibber_transport_set_handler (transport, transport_handler, self);
+ /* The transport will already be connected if it is created from
+ * GibberListener. In this case, set the bytestream to open, otherwise
+ * it will be done in transport_connected_cb. */
if (gibber_transport_get_state (transport) == GIBBER_TRANSPORT_CONNECTED)
{
g_object_set (self, "state", GIBBER_BYTESTREAM_STATE_OPEN,
--
1.5.6.5
More information about the Telepathy-commits
mailing list