aboutsummaryrefslogtreecommitdiff
path: root/src/helpers/async_callback.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-04-04 16:31:38 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-04-04 16:31:38 +0200
commit7dc39d8f939b431e9f926622819fafb306956cc6 (patch)
tree72e3e89bc5c0f41935dbfb0c2253f71f536bf4ce /src/helpers/async_callback.cpp
parent079b0cf04d38bf0c96604e55276c94c13d996531 (diff)
downloadlibadwaitamm-7dc39d8f939b431e9f926622819fafb306956cc6.tar.xz
libadwaitamm-7dc39d8f939b431e9f926622819fafb306956cc6.zip
adw: implement required AlertDialog functions
Diffstat (limited to 'src/helpers/async_callback.cpp')
-rw-r--r--src/helpers/async_callback.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/helpers/async_callback.cpp b/src/helpers/async_callback.cpp
new file mode 100644
index 0000000..4f148f0
--- /dev/null
+++ b/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