Merge branch 'fix-filetransfer-mimetype' into 'main'

portal: Use the right mimetype for file transfers

Closes #5182

See merge request GNOME/gtk!5033
This commit is contained in:
Matthias Clasen 2022-09-16 00:35:13 +00:00
commit ffb6f39715

View File

@ -483,6 +483,34 @@ connection_closed (GDBusConnection *connection,
static void static void
finish_registration (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, gdk_content_register_serializer (G_TYPE_FILE,
"application/vnd.portal.files", "application/vnd.portal.files",
portal_file_serializer, portal_file_serializer,