[network-manager-iodine: 3/7] all: use nm_connection_get_setting_*()



commit c53b571dbaae1644d0e5f585046694aadd868d13
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  |   12 +++---------
 src/nm-iodine-service.c |    6 ++----
 2 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/properties/nm-iodine.c b/properties/nm-iodine.c
index 41ed7af..2806e90 100644
--- a/properties/nm-iodine.c
+++ b/properties/nm-iodine.c
@@ -153,7 +153,6 @@ export (NMVpnPluginUiInterface *iface,
         NMConnection *connection,
         GError **error)
 {
-       NMSettingConnection *s_con;
        NMSettingVPN *s_vpn;
        const char *value;
        const char *topdomain = NULL;
@@ -168,11 +167,7 @@ export (NMVpnPluginUiInterface *iface,
                return FALSE;
        }
 
-       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))
@@ -197,7 +192,7 @@ export (NMVpnPluginUiInterface *iface,
                         "Topdomain=%s\n"
                         "Nameserver=%s\n"
                         "Fragsize=%s\n",
-                        /* Description */ nm_setting_connection_get_id (s_con),
+                        /* Description */ nm_connection_get_id (connection),
                         /* Topdomain */   topdomain,
                         /* Nameserver */  nameserver,
                         /* Fragsize */    fragsize);
@@ -425,8 +420,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]