[vino] Relay tube-disconnected signal in VinoDbusListener



commit 970207fdc820bb11b4e1ac23ac16b5ef37cf7d0d
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Apr 24 12:15:45 2012 +0200

    Relay tube-disconnected signal in VinoDbusListener
    
    See bug 651960.

 server/vino-dbus-listener.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/server/vino-dbus-listener.c b/server/vino-dbus-listener.c
index 0ed255f..0d17798 100644
--- a/server/vino-dbus-listener.c
+++ b/server/vino-dbus-listener.c
@@ -26,6 +26,7 @@
 
 #ifdef VINO_HAVE_TELEPATHY_GLIB
 #include "vino-tube-servers-manager.h"
+#include "vino-tube-server.h"
 #endif
 
 #include "vino-util.h"
@@ -35,6 +36,16 @@
 
 #include "vino-mdns.h"
 
+#ifdef VINO_HAVE_TELEPATHY_GLIB
+enum
+{
+  SIG_TUBE_DISCONNECTED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+#endif
+
 struct _VinoDBusListener
 {
   GObject  parent_instance;
@@ -79,11 +90,24 @@ vino_dbus_listener_finalize (GObject *object)
     ->finalize (object);
 }
 
+#ifdef VINO_HAVE_TELEPATHY_GLIB
+static void
+tube_disconnected_cb (VinoTubeServersManager *mgr,
+    VinoTubeServer *server,
+    VinoDBusListener *listener)
+{
+  g_signal_emit (listener, signals[SIG_TUBE_DISCONNECTED], 0, server);
+}
+#endif
+
 static void
 vino_dbus_listener_init (VinoDBusListener *listener)
 {
 #ifdef VINO_HAVE_TELEPATHY_GLIB
   listener->manager = vino_tube_servers_manager_new ();
+
+  g_signal_connect (listener->manager, "tube-disconnected",
+      G_CALLBACK (tube_disconnected_cb), listener);
 #endif
 }
 
@@ -91,6 +115,15 @@ static void
 vino_dbus_listener_class_init (GObjectClass *class)
 {
   class->finalize = vino_dbus_listener_finalize;
+
+#ifdef VINO_HAVE_TELEPATHY_GLIB
+  signals[SIG_TUBE_DISCONNECTED] = g_signal_new ("tube-disconnected",
+      G_OBJECT_CLASS_TYPE (class),
+      G_SIGNAL_RUN_LAST,
+      0, NULL, NULL, NULL,
+      G_TYPE_NONE,
+      1, VINO_TYPE_TUBE_SERVER);
+#endif
 }
 
 static guint16



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]