projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ssl: Use QSslSocket directly to avoid redundant qobject_casts
[quassel.git]
/
src
/
common
/
peer.cpp
diff --git
a/src/common/peer.cpp
b/src/common/peer.cpp
index
9a9e3f5
..
e352441
100644
(file)
--- a/
src/common/peer.cpp
+++ b/
src/common/peer.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-20
16
by the Quassel Project *
+ * Copyright (C) 2005-20
20
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-20,56
+20,68
@@
#include "peer.h"
#include "peer.h"
-Peer::Peer(AuthHandler
*authHandler, QObject *
parent)
+Peer::Peer(AuthHandler
* authHandler, QObject*
parent)
: QObject(parent)
, _authHandler(authHandler)
: QObject(parent)
, _authHandler(authHandler)
-{
-
-}
+{}
-
-AuthHandler *Peer::authHandler() const
+AuthHandler* Peer::authHandler() const
{
return _authHandler;
}
{
return _authHandler;
}
-QDateTime Peer::connectedSince() const {
+QDateTime Peer::connectedSince() const
+{
return _connectedSince;
}
return _connectedSince;
}
-void Peer::setConnectedSince(const QDateTime &connectedSince) {
+void Peer::setConnectedSince(const QDateTime& connectedSince)
+{
_connectedSince = connectedSince;
}
_connectedSince = connectedSince;
}
-QString Peer::buildDate() const {
+QString Peer::buildDate() const
+{
return _buildDate;
}
return _buildDate;
}
-void Peer::setBuildDate(const QString &buildDate) {
+void Peer::setBuildDate(const QString& buildDate)
+{
_buildDate = buildDate;
}
_buildDate = buildDate;
}
-QString Peer::clientVersion() const {
+QString Peer::clientVersion() const
+{
return _clientVersion;
}
return _clientVersion;
}
-void Peer::setClientVersion(const QString &clientVersion) {
+void Peer::setClientVersion(const QString& clientVersion)
+{
_clientVersion = clientVersion;
}
_clientVersion = clientVersion;
}
-Quassel::Features Peer::features() const {
+bool Peer::hasFeature(Quassel::Feature feature) const
+{
+ return _features.isEnabled(feature);
+}
+
+Quassel::Features Peer::features() const
+{
return _features;
}
return _features;
}
-void Peer::setFeatures(Quassel::Features features) {
- _features = features;
+void Peer::setFeatures(Quassel::Features features)
+{
+ _features = std::move(features);
}
}
-int Peer::id() const {
+int Peer::id() const
+{
return _id;
}
return _id;
}
-void Peer::setId(int id) {
+void Peer::setId(int id)
+{
_id = id;
}
_id = id;
}
@@
-79,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.
// 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<quint64>(0); // 64 bit for historic reasons
return out;
}
{
Q_UNUSED(ptr);
out << static_cast<quint64>(0); // 64 bit for historic reasons
return out;
}
-QDataStream
&operator>>(QDataStream &in, PeerPtr &
ptr)
+QDataStream
& operator>>(QDataStream& in, PeerPtr&
ptr)
{
ptr = nullptr;
quint64 value;
{
ptr = nullptr;
quint64 value;