Commit 96ab3a8a authored by Jiří Klimeš's avatar Jiří Klimeš

clients: add GError parameter to nm_vpn_get_plugin_by_service()

parent ce238a70
......@@ -37,12 +37,13 @@ static gboolean plugins_loaded;
static GSList *plugins = NULL;
NMVpnEditorPlugin *
nm_vpn_get_plugin_by_service (const char *service)
nm_vpn_get_plugin_by_service (const char *service, GError **error)
{
NMVpnEditorPlugin *plugin = NULL;
NMVpnPluginInfo *plugin_info;
g_return_val_if_fail (service != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
if (G_UNLIKELY (!plugins_loaded))
nm_vpn_get_plugins ();
......@@ -51,8 +52,10 @@ nm_vpn_get_plugin_by_service (const char *service)
if (plugin_info) {
plugin = nm_vpn_plugin_info_get_editor_plugin (plugin_info);
if (!plugin)
plugin = nm_vpn_plugin_info_load_editor_plugin (plugin_info, NULL);
}
plugin = nm_vpn_plugin_info_load_editor_plugin (plugin_info, error);
} else
g_set_error_literal (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_FAILED,
_("could not get VPN plugin info"));
return plugin;
}
......@@ -80,7 +83,7 @@ nm_vpn_supports_ipv6 (NMConnection *connection)
service_type = nm_setting_vpn_get_service_type (s_vpn);
g_return_val_if_fail (service_type != NULL, FALSE);
plugin = nm_vpn_get_plugin_by_service (service_type);
plugin = nm_vpn_get_plugin_by_service (service_type, NULL);
g_return_val_if_fail (plugin != NULL, FALSE);
capabilities = nm_vpn_editor_plugin_get_capabilities (plugin);
......
......@@ -25,7 +25,7 @@
GSList *nm_vpn_get_plugins (void);
NMVpnEditorPlugin *nm_vpn_get_plugin_by_service (const char *service);
NMVpnEditorPlugin *nm_vpn_get_plugin_by_service (const char *service, GError **error);
gboolean nm_vpn_supports_ipv6 (NMConnection *connection);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment