Skip to content

Commit

Permalink
Update src/kdbindings/signal.h
Browse files Browse the repository at this point in the history
Just call connectReflective.

Co-authored-by: Leon Matthes <[email protected]>
  • Loading branch information
seanharmer and LeonMatthesKDAB authored Oct 1, 2024
1 parent bf6a0f6 commit fa28d36
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/kdbindings/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,10 @@ class Signal
*/
KDBINDINGS_WARN_UNUSED ConnectionHandle connectSingleShot(std::function<void(Args...)> const &slot)
{
ensureImpl();

auto singleShotSlot = [slot](ConnectionHandle &handle, Args... args) {
return connectReflective([slot](ConnectionHandle &handle, Args... args) {
handle.disconnect();
slot(args...);
};

return ConnectionHandle{ m_impl, m_impl->connectReflective(singleShotSlot) };
}
}

/**
Expand Down

0 comments on commit fa28d36

Please sign in to comment.