gfile: Add g_file_query_default_handler_async()

This is needed as a first step to fix the
g_app_info_launch_default_for_uri_async() function to be really
asynchronous.

It still uses the g_app_info_get_default_for_uri_scheme() and
g_app_info_get_default_for_type() functions, which may use synchronous
calls to local MIME DB.

https://gitlab.gnome.org/GNOME/glib/issues/1347
https://gitlab.gnome.org/GNOME/glib/issues/1249
This commit is contained in:
Ondrej Holy
2019-01-22 15:37:44 +01:00
parent 0a1730d7ea
commit f72a5d65e0
3 changed files with 136 additions and 0 deletions

View File

@@ -1183,6 +1183,17 @@ GLIB_AVAILABLE_IN_ALL
GAppInfo *g_file_query_default_handler (GFile *file,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_60
void g_file_query_default_handler_async (GFile *file,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GLIB_AVAILABLE_IN_2_60
GAppInfo *g_file_query_default_handler_finish (GFile *file,
GAsyncResult *result,
GError **error);
GLIB_AVAILABLE_IN_ALL
gboolean g_file_load_contents (GFile *file,
GCancellable *cancellable,