From: Manuel Nickschas Date: Wed, 17 Oct 2018 23:00:12 +0000 (+0200) Subject: sigproxy: Modernize RPC calls (remote signals) X-Git-Tag: test-travis-01~102 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=db00831bca59a012242d1ad5fac52a20c6cd2956;hp=db00831bca59a012242d1ad5fac52a20c6cd2956 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. ---