X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fpeer.cpp;h=3785326cc106f7f61d13b0afb6d9d487854a2699;hp=62b5f790197338c5ea819228c79f02eec50e51fe;hb=d367542ce54ed86fd3c8dbdbbf8210fc9a19a882;hpb=fd25e92f19d6afd4eb02844bcbf20ba132868303 diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 62b5f790..3785326c 100644 --- a/src/common/peer.cpp +++ b/src/common/peer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -17,3 +17,37 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ + +#include "peer.h" + +Peer::Peer(AuthHandler *authHandler, QObject *parent) + : QObject(parent) + , _authHandler(authHandler) +{ + +} + + +AuthHandler *Peer::authHandler() const +{ + return _authHandler; +} + + +// Note that we need to use a fixed-size integer instead of uintptr_t, in order +// to avoid issues with different architectures for client and core. +// In practice, we'll never really have to restore the real value of a PeerPtr from +// a QVariant. +QDataStream &operator<<(QDataStream &out, PeerPtr ptr) +{ + out << reinterpret_cast(ptr); + return out; +} + +QDataStream &operator>>(QDataStream &in, PeerPtr &ptr) +{ + quint64 value; + in >> value; + ptr = reinterpret_cast(value); + return in; +}