libnm/vpn: add nm_vpn_plugin_info_get_service()
Re-add nm_vpn_plugin_info_get_service(). This function *is* useful
and could be used by nm-applet.
This reverts commit 3517084b92
.
This commit is contained in:
@@ -528,7 +528,7 @@ nm_vpn_plugin_info_list_find_by_service (GSList *list, const char *service)
|
|||||||
|
|
||||||
/* First, consider the primary service name. */
|
/* First, consider the primary service name. */
|
||||||
for (iter = list; iter; iter = iter->next) {
|
for (iter = list; iter; iter = iter->next) {
|
||||||
if (strcmp (NM_VPN_PLUGIN_INFO_GET_PRIVATE (iter->data)->service, service) == 0)
|
if (strcmp (nm_vpn_plugin_info_get_service (iter->data), service) == 0)
|
||||||
return iter->data;
|
return iter->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -578,6 +578,22 @@ nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self)
|
|||||||
return NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->name;
|
return NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_vpn_plugin_info_get_service:
|
||||||
|
* @self: plugin info instance
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): the service. Cannot be %NULL.
|
||||||
|
*
|
||||||
|
* Since: 1.4
|
||||||
|
*/
|
||||||
|
const char *
|
||||||
|
nm_vpn_plugin_info_get_service (NMVpnPluginInfo *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL);
|
||||||
|
|
||||||
|
return NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->service;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_vpn_plugin_info_get_plugin:
|
* nm_vpn_plugin_info_get_plugin:
|
||||||
* @self: plugin info instance
|
* @self: plugin info instance
|
||||||
@@ -756,7 +772,7 @@ nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self, GError **error)
|
|||||||
|
|
||||||
priv->editor_plugin_loaded = TRUE;
|
priv->editor_plugin_loaded = TRUE;
|
||||||
priv->editor_plugin = nm_vpn_editor_plugin_load_from_file (plugin_filename,
|
priv->editor_plugin = nm_vpn_editor_plugin_load_from_file (plugin_filename,
|
||||||
priv->service,
|
nm_vpn_plugin_info_get_service (self),
|
||||||
getuid (),
|
getuid (),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@@ -74,6 +74,8 @@ NM_AVAILABLE_IN_1_2
|
|||||||
const char *nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self);
|
const char *nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
const char *nm_vpn_plugin_info_get_filename (NMVpnPluginInfo *self);
|
const char *nm_vpn_plugin_info_get_filename (NMVpnPluginInfo *self);
|
||||||
|
NM_AVAILABLE_IN_1_4
|
||||||
|
const char *nm_vpn_plugin_info_get_service (NMVpnPluginInfo *self);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
const char *nm_vpn_plugin_info_get_plugin (NMVpnPluginInfo *self);
|
const char *nm_vpn_plugin_info_get_plugin (NMVpnPluginInfo *self);
|
||||||
NM_AVAILABLE_IN_1_2
|
NM_AVAILABLE_IN_1_2
|
||||||
|
@@ -1062,4 +1062,5 @@ global:
|
|||||||
libnm_1_4_0 {
|
libnm_1_4_0 {
|
||||||
global:
|
global:
|
||||||
nm_vpn_editor_plugin_load;
|
nm_vpn_editor_plugin_load;
|
||||||
|
nm_vpn_plugin_info_get_service;
|
||||||
} libnm_1_2_0;
|
} libnm_1_2_0;
|
||||||
|
@@ -2019,10 +2019,8 @@ nm_vpn_connection_activate (NMVpnConnection *self,
|
|||||||
s_vpn = nm_connection_get_setting_vpn (_get_applied_connection (self));
|
s_vpn = nm_connection_get_setting_vpn (_get_applied_connection (self));
|
||||||
g_return_if_fail (s_vpn);
|
g_return_if_fail (s_vpn);
|
||||||
|
|
||||||
service = nm_vpn_plugin_info_lookup_property (plugin_info,
|
service = nm_vpn_plugin_info_get_service (plugin_info);
|
||||||
NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION,
|
nm_assert (service);
|
||||||
"service");
|
|
||||||
g_return_if_fail (service);
|
|
||||||
|
|
||||||
if (nm_vpn_plugin_info_supports_multiple (plugin_info)) {
|
if (nm_vpn_plugin_info_supports_multiple (plugin_info)) {
|
||||||
const char *path;
|
const char *path;
|
||||||
|
Reference in New Issue
Block a user