diff options
| author | Melvin Keskin <melvo@olomono.de> | 2022-01-23 17:59:41 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-02-02 15:20:33 +0100 |
| commit | 9d47d81a727590d6b3c0603c67530d33dc051387 (patch) | |
| tree | 05de0cc3c42d003b8aa08a5e03ad554683cd5a35 /src | |
| parent | 14bf148c87fbb33c50b2b5cd1cdcf9c1d51f8d35 (diff) | |
| download | qxmpp-9d47d81a727590d6b3c0603c67530d33dc051387.tar.gz | |
FutureUtils: Add method for reporting finished with result
QFutureInterface comes with a reportFinished(T *result = nullptr)
function, but it only accepts the value by pointer which is inconvenient
in some cases.
Diffstat (limited to 'src')
| -rw-r--r-- | src/base/QXmppFutureUtils_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/base/QXmppFutureUtils_p.h b/src/base/QXmppFutureUtils_p.h index 61a9075b..1d7b47bc 100644 --- a/src/base/QXmppFutureUtils_p.h +++ b/src/base/QXmppFutureUtils_p.h @@ -169,6 +169,13 @@ auto chainIq(QFuture<Input> &&input, QObject *context) -> QFuture<Result> }); } +template<typename T> +void reportFinishedResult(QFutureInterface<T> &interface, const T &result) +{ + interface.reportResult(result); + interface.reportFinished(); +} + } #endif // QXMPPFUTUREUTILS_P_H |
