funchelpers: Support the invocation of non-void callables
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 31 Oct 2018 23:39:21 +0000 (00:39 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commita22e08480288685d73d9abd18c6a1087451c388b
treec18dca49a7fe09143bccf2d46e500b81cf7d8e86
parentb7936062b08a743e6dec917ac5e727e7b2cd3bb8
funchelpers: Support the invocation of non-void callables

Let invokeWithArgsList() handle and return the return value of
non-void callables wrapped in a QVariant. To avoid special-casing,
the invocation of a void callable also returns a (default-constructed,
thus invalid) QVariant.

To indicate failure, wrap the QVariant in a boost::optional that is
empty if the callable could not be invoked.
src/common/funchelpers.h
src/common/signalproxy.h
tests/common/funchelperstest.cpp