From 3d464695bf5b57c969f30e6f3b8b429890f976bf Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 23 Jan 2014 01:17:46 +0100 Subject: [PATCH] Let RemotePeer(s) tell their protocol type and features Knowing a peer's supported procotol type will come in handy once we support more than one protocol. Also, peers may support specific features which they can now report via the new accessor. --- src/common/protocols/legacy/legacypeer.h | 3 ++- src/common/remotepeer.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/protocols/legacy/legacypeer.h b/src/common/protocols/legacy/legacypeer.h index d364c6cd..1d09dd6b 100644 --- a/src/common/protocols/legacy/legacypeer.h +++ b/src/common/protocols/legacy/legacypeer.h @@ -42,7 +42,8 @@ public: }; LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0); - ~LegacyPeer() {} + + Protocol::Type protocol() const { return Protocol::LegacyProtocol; } void setSignalProxy(SignalProxy *proxy); diff --git a/src/common/remotepeer.h b/src/common/remotepeer.h index 14d49f94..191439ef 100644 --- a/src/common/remotepeer.h +++ b/src/common/remotepeer.h @@ -42,11 +42,12 @@ public: using Peer::dispatch; RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0); - virtual ~RemotePeer() {}; void setSignalProxy(SignalProxy *proxy); - QString description() const; + virtual Protocol::Type protocol() const = 0; + virtual QString description() const; + virtual quint16 enabledFeatures() const { return 0; } bool isOpen() const; bool isSecure() const; -- 2.20.1