X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsignalproxy.h;h=63d3438a98b896ecf9dfc490b1a0853a504d3026;hb=ebe14ade2f3496aefc8926ce704a161c4451fedd;hp=e98f6bfcff1dfed6c376d89a56c38cac743d8015;hpb=2c4e055125a3e3ab7a2bd0d9c0ea33415f6ce7cc;p=quassel.git diff --git a/src/common/signalproxy.h b/src/common/signalproxy.h index e98f6bfc..63d3438a 100644 --- a/src/common/signalproxy.h +++ b/src/common/signalproxy.h @@ -24,6 +24,8 @@ #include #include +#include + #include "protocol.h" struct QMetaObject; @@ -78,9 +80,10 @@ public: void dumpProxyStats(); void dumpSyncMap(SyncableObject *object); + /**@{*/ /** * This method allows to send a signal only to a limited set of peers - * @param peerIds A list of peers that should receive it + * @param peers A list of peers that should receive it * @param closure Code you want to execute within of that restricted environment */ void restrictTargetPeers(QSet peers, std::function closure); @@ -94,12 +97,13 @@ public: #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #ifdef Q_COMPILER_INITIALIZER_LISTS void restrictTargetPeers(std::initializer_list peers, std::function closure) { - restrictTargetPeers(QSet(peers), std::move(closure)); + restrictTargetPeers(QSet(peers), std::move(closure)); } #endif #endif + /**}@*/ - inline int peerCount() const { return _peers.size(); } + inline int peerCount() const { return _peerMap.size(); } QVariantList peerData(); Peer *peerById(int peerId); @@ -173,7 +177,6 @@ private: static void disconnectDevice(QIODevice *dev, const QString &reason = QString()); - QSet _peers; QHash _peerMap; // containg a list of argtypes for fast access @@ -202,7 +205,7 @@ private: QSet _restrictedTargets; bool _restrictMessageTarget = false; - Peer *_sourcePeer; + Peer *_sourcePeer = nullptr; friend class SignalRelay; friend class SyncableObject;