mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-08 18:24:04 +02:00
Merge branch 'issue-1104-avoid-crash' into 'main'
Add vfunc checks in gappinfo.c See merge request GNOME/glib!2365
This commit is contained in:
@@ -326,7 +326,12 @@ g_app_info_set_as_default_for_type (GAppInfo *appinfo,
|
|||||||
|
|
||||||
iface = G_APP_INFO_GET_IFACE (appinfo);
|
iface = G_APP_INFO_GET_IFACE (appinfo);
|
||||||
|
|
||||||
return (* iface->set_as_default_for_type) (appinfo, content_type, error);
|
if (iface->set_as_default_for_type)
|
||||||
|
return (* iface->set_as_default_for_type) (appinfo, content_type, error);
|
||||||
|
|
||||||
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||||
|
_("Setting default applications not supported yet"));
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -354,7 +359,12 @@ g_app_info_set_as_last_used_for_type (GAppInfo *appinfo,
|
|||||||
|
|
||||||
iface = G_APP_INFO_GET_IFACE (appinfo);
|
iface = G_APP_INFO_GET_IFACE (appinfo);
|
||||||
|
|
||||||
return (* iface->set_as_last_used_for_type) (appinfo, content_type, error);
|
if (iface->set_as_last_used_for_type)
|
||||||
|
return (* iface->set_as_last_used_for_type) (appinfo, content_type, error);
|
||||||
|
|
||||||
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||||
|
_("Setting application as last used for type not supported yet"));
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -5093,6 +5093,15 @@ g_win32_app_info_launch_uris (GAppInfo *appinfo,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
g_win32_app_info_should_show (GAppInfo *appinfo)
|
||||||
|
{
|
||||||
|
/* FIXME: This is a placeholder implementation to avoid crashes
|
||||||
|
* for now. It can be made more specific to @appinfo in future. */
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
g_win32_app_info_launch (GAppInfo *appinfo,
|
g_win32_app_info_launch (GAppInfo *appinfo,
|
||||||
GList *files,
|
GList *files,
|
||||||
@@ -5229,7 +5238,7 @@ g_win32_app_info_iface_init (GAppInfoIface *iface)
|
|||||||
iface->supports_uris = g_win32_app_info_supports_uris;
|
iface->supports_uris = g_win32_app_info_supports_uris;
|
||||||
iface->supports_files = g_win32_app_info_supports_files;
|
iface->supports_files = g_win32_app_info_supports_files;
|
||||||
iface->launch_uris = g_win32_app_info_launch_uris;
|
iface->launch_uris = g_win32_app_info_launch_uris;
|
||||||
/* iface->should_show = g_win32_app_info_should_show;*/
|
iface->should_show = g_win32_app_info_should_show;
|
||||||
/* iface->set_as_default_for_type = g_win32_app_info_set_as_default_for_type;*/
|
/* iface->set_as_default_for_type = g_win32_app_info_set_as_default_for_type;*/
|
||||||
/* iface->set_as_default_for_extension = g_win32_app_info_set_as_default_for_extension;*/
|
/* iface->set_as_default_for_extension = g_win32_app_info_set_as_default_for_extension;*/
|
||||||
/* iface->add_supports_type = g_win32_app_info_add_supports_type;*/
|
/* iface->add_supports_type = g_win32_app_info_add_supports_type;*/
|
||||||
|
Reference in New Issue
Block a user