From 67c561efbeaa26131258c41b208f1890cb4865c5 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 4 Apr 2025 16:31:38 +0200 Subject: adw: implement required AlertDialog functions --- adw/src/helpers/async_callback.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 adw/src/helpers/async_callback.cpp (limited to 'adw/src/helpers') diff --git a/adw/src/helpers/async_callback.cpp b/adw/src/helpers/async_callback.cpp new file mode 100644 index 0000000..4f148f0 --- /dev/null +++ b/adw/src/helpers/async_callback.cpp @@ -0,0 +1,28 @@ +#include "adwaitamm/helpers/async_callback.hpp" + +#include +#include + +#include + +#include + +namespace Adwaita::helpers +{ + + auto async_callback(GObject *, GAsyncResult * result, void * data) noexcept -> void + { + auto slot = std::unique_ptr(static_cast(data)); + + try + { + auto actual_result = Glib::wrap(result, true); + (*slot)(actual_result); + } + catch (...) + { + Glib::exception_handlers_invoke(); + } + } + +} // namespace Adwaita::helpers \ No newline at end of file -- cgit v1.2.3