openuriportal: Add a check function
authorMatthias Clasen <mclasen@redhat.com>
Tue, 29 Nov 2022 18:03:34 +0000 (13:03 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 9 Dec 2022 16:05:48 +0000 (11:05 -0500)
Add private API to check whether the portal
is available.

gtk/gopenuriportal.c
gtk/gopenuriportal.h

index e13b5c2377e03dd3462d58455f7f44090473f16b..715622ed326c1727f46de5337c3df7049915610d 100644 (file)
@@ -80,6 +80,12 @@ init_openuri_portal (void)
   return openuri != NULL;
 }
 
+gboolean
+g_openuri_portal_is_available (void)
+{
+  return init_openuri_portal ();
+}
+
 enum {
   XDG_DESKTOP_PORTAL_SUCCESS   = 0,
   XDG_DESKTOP_PORTAL_CANCELLED = 1,
index 3cdfcf9f81103f4ba157cf6935e9f765b052c801..cd3992f6c2e53075613309561671dd91f2caa47a 100644 (file)
 
 G_BEGIN_DECLS
 
-void     g_openuri_portal_open_async  (GFile               *file,
-                                       gboolean             open_folder,
-                                       GtkWindow           *window,
-                                       GCancellable        *cancellable,
-                                       GAsyncReadyCallback  callback,
-                                       gpointer             user_data);
-
-gboolean g_openuri_portal_open_finish (GAsyncResult        *result,
-                                       GError             **error);
+gboolean g_openuri_portal_is_available (void);
+
+void     g_openuri_portal_open_async   (GFile               *file,
+                                        gboolean             open_folder,
+                                        GtkWindow           *window,
+                                        GCancellable        *cancellable,
+                                        GAsyncReadyCallback  callback,
+                                        gpointer             user_data);
+
+gboolean g_openuri_portal_open_finish  (GAsyncResult        *result,
+                                        GError             **error);
 
 G_END_DECLS