X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fpeer.cpp;h=da408b0f6d2fb11a873bada47e2e9d4df83da7fa;hp=1d459b67f34a47edc956c636726dde633f71b76c;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=30b159cb876a9495de42e9a3e70ca050516f0805 diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 1d459b67..da408b0f 100644 --- a/src/common/peer.cpp +++ b/src/common/peer.cpp @@ -20,44 +20,48 @@ #include "peer.h" -Peer::Peer(AuthHandler *authHandler, QObject *parent) +Peer::Peer(AuthHandler* authHandler, QObject* parent) : QObject(parent) , _authHandler(authHandler) -{ - -} - +{} -AuthHandler *Peer::authHandler() const +AuthHandler* Peer::authHandler() const { return _authHandler; } -QDateTime Peer::connectedSince() const { +QDateTime Peer::connectedSince() const +{ return _connectedSince; } -void Peer::setConnectedSince(const QDateTime &connectedSince) { +void Peer::setConnectedSince(const QDateTime& connectedSince) +{ _connectedSince = connectedSince; } -QString Peer::buildDate() const { +QString Peer::buildDate() const +{ return _buildDate; } -void Peer::setBuildDate(const QString &buildDate) { +void Peer::setBuildDate(const QString& buildDate) +{ _buildDate = buildDate; } -QString Peer::clientVersion() const { +QString Peer::clientVersion() const +{ return _clientVersion; } -void Peer::setClientVersion(const QString &clientVersion) { +void Peer::setClientVersion(const QString& clientVersion) +{ _clientVersion = clientVersion; } -bool Peer::hasFeature(Quassel::Feature feature) const { +bool Peer::hasFeature(Quassel::Feature feature) const +{ return _features.isEnabled(feature); } @@ -66,15 +70,18 @@ Quassel::Features Peer::features() const return _features; } -void Peer::setFeatures(Quassel::Features features) { +void Peer::setFeatures(Quassel::Features features) +{ _features = std::move(features); } -int Peer::id() const { +int Peer::id() const +{ return _id; } -void Peer::setId(int id) { +void Peer::setId(int id) +{ _id = id; } @@ -84,14 +91,14 @@ void Peer::setId(int id) { // received over the network with the actual address of the local Peer // instance. Because the actual value isn't needed on the wire, it is // serialized as null. -QDataStream &operator<<(QDataStream &out, PeerPtr ptr) +QDataStream& operator<<(QDataStream& out, PeerPtr ptr) { Q_UNUSED(ptr); out << static_cast(0); // 64 bit for historic reasons return out; } -QDataStream &operator>>(QDataStream &in, PeerPtr &ptr) +QDataStream& operator>>(QDataStream& in, PeerPtr& ptr) { ptr = nullptr; quint64 value;