portal: Use the right mimetype for file transfers
authorMatthias Clasen <mclasen@redhat.com>
Thu, 15 Sep 2022 18:55:55 +0000 (14:55 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 15 Sep 2022 19:18:17 +0000 (15:18 -0400)
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

index bf1e2e2be54327b9194eb82d1d7834b2a4cfdb01..2904941e3931648fe95df3260b4f1c0c245203a6 100644 (file)
@@ -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,