diff options
-rw-r--r-- | gdk/filetransferportal.c | 5 | ||||
-rw-r--r-- | gdk/gdkcontentdeserializer.c | 12 | ||||
-rw-r--r-- | gdk/gdkcontentserializer.c | 12 |
3 files changed, 25 insertions, 4 deletions
diff --git a/gdk/filetransferportal.c b/gdk/filetransferportal.c index 97e4134651..bb213e1a37 100644 --- a/gdk/filetransferportal.c +++ b/gdk/filetransferportal.c @@ -24,6 +24,9 @@ #include <fcntl.h> #include <gio/gio.h> + +#ifdef G_OS_UNIX + #include <gio/gunixfdlist.h> #include "filetransferportalprivate.h" @@ -339,3 +342,5 @@ file_transfer_portal_retrieve_files_finish (GAsyncResult *result, return FALSE; } + +#endif /* G_OS_UNIX */ diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c index 4a15fa0086..79b7df86a2 100644 --- a/gdk/gdkcontentdeserializer.c +++ b/gdk/gdkcontentdeserializer.c @@ -691,6 +691,7 @@ string_deserializer (GdkContentDeserializer *deserializer) g_object_unref (filter); } +#ifdef G_OS_UNIX static void portal_finish (GObject *object, GAsyncResult *result, @@ -777,6 +778,7 @@ portal_file_deserializer (GdkContentDeserializer *deserializer) deserializer); g_object_unref (output); } +#endif /* G_OS_UNIX */ static void file_uri_deserializer_finish (GObject *source, @@ -852,7 +854,6 @@ init (void) static gboolean initialized = FALSE; GSList *formats, *f; const char *charset; - gboolean has_portal; if (initialized) return; @@ -905,24 +906,31 @@ init (void) g_slist_free (formats); - has_portal = file_transfer_portal_available (); +#ifdef G_OS_UNIX + gboolean has_portal = file_transfer_portal_available (); if (has_portal) gdk_content_register_deserializer ("application/vnd.portal.files", GDK_TYPE_FILE_LIST, portal_file_deserializer, NULL, NULL); +#endif + gdk_content_register_deserializer ("text/uri-list", GDK_TYPE_FILE_LIST, file_uri_deserializer, NULL, NULL); + +#ifdef G_OS_UNIX if (has_portal) gdk_content_register_deserializer ("application/vnd.portal.files", G_TYPE_FILE, portal_file_deserializer, NULL, NULL); +#endif + gdk_content_register_deserializer ("text/uri-list", G_TYPE_FILE, file_uri_deserializer, diff --git a/gdk/gdkcontentserializer.c b/gdk/gdkcontentserializer.c index cac4378cc2..592a7a9428 100644 --- a/gdk/gdkcontentserializer.c +++ b/gdk/gdkcontentserializer.c @@ -702,6 +702,7 @@ file_serializer_finish (GObject *source, gdk_content_serializer_return_success (serializer); } +#ifdef G_OS_UNIX static void portal_ready (GObject *object, GAsyncResult *result, @@ -758,6 +759,7 @@ portal_file_serializer (GdkContentSerializer *serializer) file_transfer_portal_register_files ((const char **)files->pdata, TRUE, portal_ready, serializer); gdk_content_serializer_set_task_data (serializer, files, (GDestroyNotify)g_ptr_array_unref); } +#endif /* G_OS_UNIX */ static void file_uri_serializer (GdkContentSerializer *serializer) @@ -866,7 +868,6 @@ init (void) static gboolean initialized = FALSE; GSList *formats, *f; const char *charset; - gboolean has_portal; if (initialized) return; @@ -922,7 +923,8 @@ init (void) g_slist_free (formats); - has_portal = file_transfer_portal_available (); +#ifdef G_OS_UNIX + gboolean has_portal = file_transfer_portal_available (); if (has_portal) gdk_content_register_serializer (G_TYPE_FILE, @@ -930,6 +932,8 @@ init (void) portal_file_serializer, NULL, NULL); +#endif + gdk_content_register_serializer (G_TYPE_FILE, "text/uri-list", file_uri_serializer, @@ -940,12 +944,16 @@ init (void) file_text_serializer, NULL, NULL); + +#ifdef G_OS_UNIX if (has_portal) gdk_content_register_serializer (GDK_TYPE_FILE_LIST, "application/vnd.portal.files", portal_file_serializer, NULL, NULL); +#endif + gdk_content_register_serializer (GDK_TYPE_FILE_LIST, "text/uri-list", file_uri_serializer, |