[gtk/fix.nonunix.builds: 1/2] gdk: Build portal bits on *nix only
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix.nonunix.builds: 1/2] gdk: Build portal bits on *nix only
- Date: Mon, 16 Dec 2019 10:07:30 +0000 (UTC)
commit 9441322730de5f8fde33b8415b6d615117b8f079
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Sat Dec 14 11:13:21 2019 +0800
gdk: Build portal bits on *nix only
The newly-added portal items are supported on *nix only, so only build
them on *nix.
gdk/gdkcontentdeserializer.c | 9 +++++++++
gdk/gdkcontentserializer.c | 9 +++++++++
gdk/meson.build | 7 ++++++-
3 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c
index 4a15fa0086..a2a8c24353 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,
@@ -905,6 +907,7 @@ init (void)
g_slist_free (formats);
+#ifdef G_OS_UNIX
has_portal = file_transfer_portal_available ();
if (has_portal)
gdk_content_register_deserializer ("application/vnd.portal.files",
@@ -912,17 +915,23 @@ init (void)
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..2a790f7bdf 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)
@@ -922,6 +924,7 @@ init (void)
g_slist_free (formats);
+#ifdef G_OS_UNIX
has_portal = file_transfer_portal_available ();
if (has_portal)
@@ -930,6 +933,8 @@ init (void)
portal_file_serializer,
NULL,
NULL);
+#endif
+
gdk_content_register_serializer (G_TYPE_FILE,
"text/uri-list",
file_uri_serializer,
@@ -940,12 +945,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,
diff --git a/gdk/meson.build b/gdk/meson.build
index ed41b126ea..b0599d1a4a 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -19,7 +19,6 @@ gdk_public_sources = files([
'gdkdrawcontext.c',
'gdkdrop.c',
'gdkevents.c',
- 'filetransferportal.c',
'gdkframeclock.c',
'gdkframeclockidle.c',
'gdkframetimings.c',
@@ -48,6 +47,12 @@ gdk_public_sources = files([
'gdkprofiler.c'
])
+if os_unix
+ gdk_public_sources += [
+ 'filetransferportal.c',
+ ]
+endif
+
gdk_public_headers = files([
'gdk-autocleanup.h',
'gdk.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]