From f17ab954f650b4fe6c825de4f6feb2e722c7131a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 2 Apr 2013 13:12:14 +0200 Subject: 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. --- libnm-util/nm-setting-vpn.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'libnm-util/nm-setting-vpn.c') diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c index 8d6031f891..b347290606 100644 --- a/libnm-util/nm-setting-vpn.c +++ b/libnm-util/nm-setting-vpn.c @@ -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); } /** -- cgit v1.2.1