diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-04 16:31:38 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-04 16:31:38 +0200 |
| commit | 67c561efbeaa26131258c41b208f1890cb4865c5 (patch) | |
| tree | 9fbb1be4094a05c371c5c6977dae733a6b4758fb /adw/src/helpers | |
| parent | b6d9a37966e34db8b5217a7e5466b2660f43a4ba (diff) | |
| download | turns-67c561efbeaa26131258c41b208f1890cb4865c5.tar.xz turns-67c561efbeaa26131258c41b208f1890cb4865c5.zip | |
adw: implement required AlertDialog functions
Diffstat (limited to 'adw/src/helpers')
| -rw-r--r-- | adw/src/helpers/async_callback.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 <glibmm/exceptionhandler.h> +#include <glibmm/object.h> + +#include <giomm/asyncresult.h> + +#include <memory> + +namespace Adwaita::helpers +{ + + auto async_callback(GObject *, GAsyncResult * result, void * data) noexcept -> void + { + auto slot = std::unique_ptr<Gio::SlotAsyncReady>(static_cast<Gio::SlotAsyncReady *>(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 |
