[network-manager-iodine/danw/cleanup-bgo746693: 3/4] all: use nm_connection_get_setting_*()



commit 8ae83c33bfaf385c79a099075c12860ce901ed3d
Author: Dan Winship <danw redhat com>
Date:   Tue Nov 25 17:28:51 2014 -0500

    all: use nm_connection_get_setting_*()
    
    The code was still using nm_connection_get_setting(). Use the typesafe
    setting-specific versions instead.

 properties/nm-iodine.c  |    6 ++----
 src/nm-iodine-service.c |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/properties/nm-iodine.c b/properties/nm-iodine.c
index 41ed7af..f8f088b 100644
--- a/properties/nm-iodine.c
+++ b/properties/nm-iodine.c
@@ -171,8 +171,7 @@ export (NMVpnPluginUiInterface *iface,
        s_con = NM_SETTING_CONNECTION (nm_connection_get_setting
                                                                   (connection, NM_TYPE_SETTING_CONNECTION));
 
-       s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection,
-                                                                                                             
  NM_TYPE_SETTING_VPN);
+       s_vpn = nm_connection_get_setting_vpn (connection);
 
        value = nm_setting_vpn_get_data_item (s_vpn, NM_IODINE_KEY_TOPDOMAIN);
        if (value && strlen (value))
@@ -425,8 +424,7 @@ init_plugin_ui (IodinePluginUiWidget *self,
        GtkWidget *widget;
        const char *value;
 
-       s_vpn = (NMSettingVPN *) nm_connection_get_setting (connection,
-                                                                                                             
  NM_TYPE_SETTING_VPN);
+       s_vpn = nm_connection_get_setting_vpn (connection);
 
        priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
diff --git a/src/nm-iodine-service.c b/src/nm-iodine-service.c
index dc97998..23fc858 100644
--- a/src/nm-iodine-service.c
+++ b/src/nm-iodine-service.c
@@ -561,8 +561,7 @@ real_connect (NMVPNPlugin   *plugin,
        NMSettingVPN *s_vpn;
        gint ret = -1;
 
-       s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection,
-                                                                                                          
NM_TYPE_SETTING_VPN));
+       s_vpn = nm_connection_get_setting_vpn (connection);
        g_assert (s_vpn);
        if (!nm_iodine_properties_validate (s_vpn, error))
                goto out;
@@ -591,8 +590,7 @@ real_need_secrets (NMVPNPlugin   *plugin,
        g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE);
        g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
 
-       s_vpn = NM_SETTING_VPN (nm_connection_get_setting (connection,
-                                                                                                          
NM_TYPE_SETTING_VPN));
+       s_vpn = nm_connection_get_setting_vpn (connection);
        if (!s_vpn) {
                g_set_error (error,
                             NM_VPN_PLUGIN_ERROR,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]