projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
53861fa
)
Minor cleanups
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 21 Dec 2017 12:44:30 +0000
(13:44 +0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 21 Dec 2017 12:44:30 +0000
(13:44 +0100)
src/common/message.cpp
patch
|
blob
|
history
src/common/peer.h
patch
|
blob
|
history
src/common/protocol.h
patch
|
blob
|
history
src/common/remotepeer.cpp
patch
|
blob
|
history
src/common/signalproxy.cpp
patch
|
blob
|
history
src/common/signalproxy.h
patch
|
blob
|
history
diff --git
a/src/common/message.cpp
b/src/common/message.cpp
index
a0e480a
..
911c935
100644
(file)
--- a/
src/common/message.cpp
+++ b/
src/common/message.cpp
@@
-21,8
+21,8
@@
#include "message.h"
#include "util.h"
#include "message.h"
#include "util.h"
-#include "signalproxy.h"
#include "peer.h"
#include "peer.h"
+#include "signalproxy.h"
#include <QDataStream>
#include <QDataStream>
diff --git
a/src/common/peer.h
b/src/common/peer.h
index
34a5661
..
fbc1791
100644
(file)
--- a/
src/common/peer.h
+++ b/
src/common/peer.h
@@
-18,8
+18,7
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef PEER_H
-#define PEER_H
+#pragma once
#include <QAbstractSocket>
#include <QDataStream>
#include <QAbstractSocket>
#include <QDataStream>
@@
-27,8
+26,8
@@
#include "authhandler.h"
#include "protocol.h"
#include "authhandler.h"
#include "protocol.h"
-#include "signalproxy.h"
#include "quassel.h"
#include "quassel.h"
+#include "signalproxy.h"
class Peer : public QObject
{
class Peer : public QObject
{
@@
-145,5
+144,3
@@
void Peer::handle(const T &protoMessage)
return;
}
}
return;
}
}
-
-#endif
diff --git
a/src/common/protocol.h
b/src/common/protocol.h
index
4576080
..
e626686
100644
(file)
--- a/
src/common/protocol.h
+++ b/
src/common/protocol.h
@@
-18,8
+18,7
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef PROTOCOL_H_
-#define PROTOCOL_H_
+#pragma once
#include <QByteArray>
#include <QDateTime>
#include <QByteArray>
#include <QDateTime>
@@
-57,7
+56,7
@@
struct HandshakeMessage {
struct RegisterClient : public HandshakeMessage
{
struct RegisterClient : public HandshakeMessage
{
- inline RegisterClient(const QString &clientVersion, const QString &buildDate, bool sslSupported = false,
int32_t
features = 0)
+ inline RegisterClient(const QString &clientVersion, const QString &buildDate, bool sslSupported = false,
quint32
features = 0)
: clientVersion(clientVersion)
, buildDate(buildDate)
, sslSupported(sslSupported)
: clientVersion(clientVersion)
, buildDate(buildDate)
, sslSupported(sslSupported)
@@
-68,7
+67,7
@@
struct RegisterClient : public HandshakeMessage
// this is only used by the LegacyProtocol in compat mode
bool sslSupported;
// this is only used by the LegacyProtocol in compat mode
bool sslSupported;
-
int32_t
clientFeatures;
+
quint32
clientFeatures;
};
};
@@
-247,5
+246,3
@@
struct HeartBeatReply
};
};
-
-#endif
diff --git
a/src/common/remotepeer.cpp
b/src/common/remotepeer.cpp
index
e25cbb3
..
7c80406
100644
(file)
--- a/
src/common/remotepeer.cpp
+++ b/
src/common/remotepeer.cpp
@@
-214,7
+214,6
@@
void RemotePeer::onReadyRead()
processMessage(msg);
processMessage(msg);
-
if (SignalProxy::current())
SignalProxy::current()->setSourcePeer(nullptr);
}
if (SignalProxy::current())
SignalProxy::current()->setSourcePeer(nullptr);
}
diff --git
a/src/common/signalproxy.cpp
b/src/common/signalproxy.cpp
index
bcc639f
..
bf07f28
100644
(file)
--- a/
src/common/signalproxy.cpp
+++ b/
src/common/signalproxy.cpp
@@
-173,6
+173,9
@@
int SignalProxy::SignalRelay::qt_metacall(QMetaObject::Call _c, int _id, void **
// ==================================================
// SignalProxy
// ==================================================
// ==================================================
// SignalProxy
// ==================================================
+
+thread_local SignalProxy *SignalProxy::_current{nullptr};
+
SignalProxy::SignalProxy(QObject *parent)
: QObject(parent)
{
SignalProxy::SignalProxy(QObject *parent)
: QObject(parent)
{
@@
-204,6
+207,8
@@
SignalProxy::~SignalProxy()
_syncSlave.clear();
removeAllPeers();
_syncSlave.clear();
removeAllPeers();
+
+ _current = nullptr;
}
}
@@
-221,9
+226,6
@@
void SignalProxy::setProxyMode(ProxyMode mode)
initClient();
}
initClient();
}
-thread_local SignalProxy *SignalProxy::_current;
-
-
void SignalProxy::init()
{
_heartBeatInterval = 0;
void SignalProxy::init()
{
_heartBeatInterval = 0;
@@
-516,15
+518,9
@@
void SignalProxy::stopSynchronize(SyncableObject *obj)
template<class T>
void SignalProxy::dispatch(const T &protoMessage)
{
template<class T>
void SignalProxy::dispatch(const T &protoMessage)
{
- for (auto peer : _peerMap.values()) {
- _targetPeer = peer;
-
- if (peer->isOpen())
- peer->dispatch(protoMessage);
- else
- QCoreApplication::postEvent(this, new ::RemovePeerEvent(peer));
+ for (auto&& peer : _peerMap.values()) {
+ dispatch(peer, protoMessage);
}
}
- _targetPeer = nullptr;
}
}
diff --git
a/src/common/signalproxy.h
b/src/common/signalproxy.h
index
77ef3a4
..
ac4b8c6
100644
(file)
--- a/
src/common/signalproxy.h
+++ b/
src/common/signalproxy.h
@@
-18,15
+18,13
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef SIGNALPROXY_H
-#define SIGNALPROXY_H
+#pragma once
#include <QEvent>
#include <QSet>
#include <QEvent>
#include <QSet>
-#include <QThreadStorage>
#include <functional>
#include <functional>
-#include <
memory
>
+#include <
initializer_list
>
#include "protocol.h"
#include "protocol.h"
@@
-286,5
+284,3
@@
private:
QHash<QByteArray, int> _methodIds;
QHash<int, int> _receiveMap; // if slot x is called then hand over the result to slot y
};
QHash<QByteArray, int> _methodIds;
QHash<int, int> _receiveMap; // if slot x is called then hand over the result to slot y
};
-
-#endif