sigproxy: Modernize RPC calls (remote signals)
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 17 Oct 2018 23:00:12 +0000 (01:00 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commitdb00831bca59a012242d1ad5fac52a20c6cd2956
treefbd3aa5eddf63adda2cb3a0795346c3b4eb81c06
parentb8ce41ef6c0036d854f5bef0fb52e2a69dc5def2
sigproxy: Modernize RPC calls (remote signals)

The previous implementation relied on undocumented Qt internals to
transform signals into RpcCall messages. It also relied on the
old-style, slow signal/slot connections and required RPC call
receivers to be actual slots, a feature deprecated in Qt.

Reimplement this feature to make use of PMF connections. Utilize
C++14 features such as variadic lambdas and templates to shift
most of the work to compile time, which is not only more efficient,
but also gives us compile-time checks for most things.

Arguments are now marshalled to and from QVariant using the methods
intended for the purpose, rather than reinterpreting void pointers
into raw memory (which mimicked the way Qt works internally, but
is of course fully unsupported, even though it miraculously worked
basically unchanged since the early days of Qt 4...). The marshalling
code is generated at compile time, which is more efficient than the
previous approach of looking up types and constructing arguments
at runtime.

SignalProxy::attachSignal() now expects the signal to be given as a
member function pointer. SignalProxy::attachSlot() supports member
function pointers as well as functors, similar to QObject::connect().

Remove SignalRelay and related methods that are no longer needed.

While we're at it, rename RpcCall's slotName attribute to signalName,
which better reflects reality.

The reimplementation does not affect the protocol; the serialization
format remains unchanged.
src/client/client.cpp
src/common/protocol.h
src/common/protocols/datastream/datastreampeer.cpp
src/common/protocols/legacy/legacypeer.cpp
src/common/signalproxy.cpp
src/common/signalproxy.h
src/core/coresession.cpp
src/qtui/debugconsole.cpp
src/test/util/mockedpeer.cpp
src/test/util/mockedpeer.h
tests/common/signalproxytest.cpp