[gtk/fix-filetransfer-mimetype] portal: Use the right mimetype for file transfers




commit df6daadb570e6ecb856aca3d835f5f94b31c1fec
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 15 14:55:55 2022 -0400

    portal: Use the right mimetype for file transfers
    
    The filetransfer protocol says to use
    application/vnd.portal.filetransfer, but I used
    application/vnd.portal.files when I implemented the
    protocol. Oops.
    
    This commit dds the correct mimetype, but we still
    support the old one to preserve interoperatibility
    with existing flatpaks using GTK 4.6.
    
    Fixes: #5182

 gdk/filetransferportal.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
diff --git a/gdk/filetransferportal.c b/gdk/filetransferportal.c
index bf1e2e2be5..2904941e39 100644
--- a/gdk/filetransferportal.c
+++ b/gdk/filetransferportal.c
@@ -483,6 +483,34 @@ connection_closed (GDBusConnection *connection,
 static void
 finish_registration (void)
 {
+  gdk_content_register_serializer (G_TYPE_FILE,
+                                   "application/vnd.portal.filetransfer",
+                                   portal_file_serializer,
+                                   NULL,
+                                   NULL);
+
+  gdk_content_register_serializer (GDK_TYPE_FILE_LIST,
+                                   "application/vnd.portal.filetransfer",
+                                   portal_file_serializer,
+                                   NULL,
+                                   NULL);
+
+  gdk_content_register_deserializer ("application/vnd.portal.filetransfer",
+                                     GDK_TYPE_FILE_LIST,
+                                     portal_file_deserializer,
+                                     NULL,
+                                     NULL);
+
+  gdk_content_register_deserializer ("application/vnd.portal.filetransfer",
+                                     G_TYPE_FILE,
+                                     portal_file_deserializer,
+                                     NULL,
+                                     NULL);
+
+  /* FIXME: I missed up and used the wrong mime type here when
+   * I implemented my own protocol. Keep these around for a while
+   * so we can interoperate with existing flatpaks using GTK 4.6
+   */
   gdk_content_register_serializer (G_TYPE_FILE,
                                    "application/vnd.portal.files",
                                    portal_file_serializer,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]