GAppInfo: Add async API to get default Application for content type

Make possible to fetch the Application for default content type in a
thread without using blocking I/O.
This commit is contained in:
Marco Trevisan (Treviño)
2022-06-01 21:45:58 +02:00
parent abae8c1f05
commit 44dbd43170
4 changed files with 225 additions and 0 deletions

View File

@@ -246,6 +246,15 @@ void g_app_info_reset_type_associations (const char *content_type);
GLIB_AVAILABLE_IN_ALL
GAppInfo *g_app_info_get_default_for_type (const char *content_type,
gboolean must_support_uris);
GLIB_AVAILABLE_IN_2_74
void g_app_info_get_default_for_type_async (const char *content_type,
gboolean must_support_uris,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GLIB_AVAILABLE_IN_2_74
GAppInfo *g_app_info_get_default_for_type_finish (GAsyncResult *result,
GError **error);
GLIB_AVAILABLE_IN_ALL
GAppInfo *g_app_info_get_default_for_uri_scheme (const char *uri_scheme);