libnm-util: make nm_setting_vpn_remove_*() return gboolean instead of void

to match other property removal functions, like nm_setting_bond_remove_option()
or nm_setting_wired_remove_s390_option().

Note:
This is an API change, make sure to bump soname when releasing libnm-util.
This commit is contained in:
Jiří Klimeš 2013-04-02 13:12:14 +02:00
parent 228f6459e1
commit f17ab954f6
2 changed files with 15 additions and 9 deletions

View file

@ -223,13 +223,16 @@ nm_setting_vpn_get_data_item (NMSettingVPN *setting, const char *key)
*
* Deletes a key/value relationship previously established by
* nm_setting_vpn_add_data_item().
*
* Returns: %TRUE if the data item was found and removed from the internal list,
* %FALSE if it was not.
**/
void
gboolean
nm_setting_vpn_remove_data_item (NMSettingVPN *setting, const char *key)
{
g_return_if_fail (NM_IS_SETTING_VPN (setting));
g_return_val_if_fail (NM_IS_SETTING_VPN (setting), FALSE);
g_hash_table_remove (NM_SETTING_VPN_GET_PRIVATE (setting)->data, key);
return g_hash_table_remove (NM_SETTING_VPN_GET_PRIVATE (setting)->data, key);
}
static void
@ -347,13 +350,16 @@ nm_setting_vpn_get_secret (NMSettingVPN *setting, const char *key)
*
* Deletes a key/value relationship previously established by
* nm_setting_vpn_add_secret().
*
* Returns: %TRUE if the secret was found and removed from the internal list,
* %FALSE if it was not.
**/
void
gboolean
nm_setting_vpn_remove_secret (NMSettingVPN *setting, const char *key)
{
g_return_if_fail (NM_IS_SETTING_VPN (setting));
g_return_val_if_fail (NM_IS_SETTING_VPN (setting), FALSE);
g_hash_table_remove (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, key);
return g_hash_table_remove (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, key);
}
/**

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2011 Red Hat, Inc.
* (C) Copyright 2007 - 2013 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -95,7 +95,7 @@ void nm_setting_vpn_add_data_item (NMSettingVPN *setting,
const char *item);
const char * nm_setting_vpn_get_data_item (NMSettingVPN *setting,
const char *key);
void nm_setting_vpn_remove_data_item (NMSettingVPN *setting,
gboolean nm_setting_vpn_remove_data_item (NMSettingVPN *setting,
const char *key);
void nm_setting_vpn_foreach_data_item (NMSettingVPN *setting,
NMVPNIterFunc func,
@ -107,7 +107,7 @@ void nm_setting_vpn_add_secret (NMSettingVPN *setting,
const char *secret);
const char * nm_setting_vpn_get_secret (NMSettingVPN *setting,
const char *key);
void nm_setting_vpn_remove_secret (NMSettingVPN *setting,
gboolean nm_setting_vpn_remove_secret (NMSettingVPN *setting,
const char *key);
void nm_setting_vpn_foreach_secret (NMSettingVPN *setting,
NMVPNIterFunc func,