SignanlProxy does no longer try to write to closed devices. Also closed devices can...
[quassel.git] / src / common / signalproxy.h
index 9243608..755461e 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef SIGNALPROXY_H
 #define SIGNALPROXY_H
 
+#include <QEvent>
 #include <QList>
 #include <QHash>
 #include <QVariant>
@@ -55,6 +56,16 @@ public:
     HeartBeatReply
   };
 
+  enum ClientConnectionType {
+    SignalProxyConnection,
+    IODeviceConnection
+  };
+
+  enum CustomEvents {
+    PeerSignal = QEvent::User,
+    RemovePeer
+  };
+
   SignalProxy(QObject *parent);
   SignalProxy(ProxyMode mode, QObject *parent);
   SignalProxy(ProxyMode mode, QIODevice *device, QObject *parent);
@@ -180,6 +191,8 @@ public:
   inline int peerCount() const { return _peers.size(); }
   
 private:
+  static void disconnectDevice(QIODevice *dev, const QString &reason = QString());
+
   class AbstractPeer {
   public:
     enum PeerType {
@@ -227,16 +240,6 @@ private:
   // currently a communication object can either be an arbitrary QIODevice or another SignalProxy
   typedef QHash<QObject *, AbstractPeer *> PeerHash;
   PeerHash _peers;
-  
-//   // Hash of used QIODevices
-//   struct peerInfo {
-//     quint32 byteCount;
-//     bool usesCompression;
-//     int sentHeartBeats;
-//     int lag;
-//     peerInfo() : byteCount(0), usesCompression(false), sentHeartBeats(0) {}
-//   };
-//   QHash<QIODevice*, peerInfo> _peers;
 
   // containg a list of argtypes for fast access
   QHash<const QMetaObject *, ClassInfo*> _classInfo;