network-manager-applet r978 - in trunk: . src src/connection-editor



Author: dcbw
Date: Sun Oct 26 22:02:33 2008
New Revision: 978
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=978&view=rev

Log:
2008-10-26  Dan Williams  <dcbw redhat com>

	Patch from Tambet Ingo <tambet gmail com>

	* src/applet-device-cdma.c
	  src/connection-editor/nm-connection-list.c
	  src/connection-editor/page-mobile.c
		- Use cdma setting accessors



Modified:
   trunk/ChangeLog
   trunk/src/applet-device-cdma.c
   trunk/src/connection-editor/nm-connection-list.c
   trunk/src/connection-editor/page-mobile.c

Modified: trunk/src/applet-device-cdma.c
==============================================================================
--- trunk/src/applet-device-cdma.c	(original)
+++ trunk/src/applet-device-cdma.c	Sun Oct 26 22:02:33 2008
@@ -68,7 +68,8 @@
 	connection = nm_connection_new ();
 
 	s_cdma = NM_SETTING_CDMA (nm_setting_cdma_new ());
-	s_cdma->number = g_strdup ("#777"); /* De-facto standard for CDMA */
+	/* De-facto standard for CDMA */
+	g_object_set (s_cdma, NM_SETTING_CDMA_NUMBER, "#777", NULL);
 	nm_connection_add_setting (connection, NM_SETTING (s_cdma));
 
 	/* Serial setting */
@@ -369,8 +370,9 @@
 	setting = NM_SETTING_CDMA (nm_connection_get_setting (info->connection, NM_TYPE_SETTING_CDMA));
 
 	if (!strcmp (info->secret_name, NM_SETTING_CDMA_PASSWORD)) {
-		g_free (setting->password);
-		setting->password = g_strdup (gtk_entry_get_text (info->secret_entry));
+		g_object_set (setting, 
+			      NM_SETTING_CDMA_PASSWORD, gtk_entry_get_text (info->secret_entry),
+			      NULL);
 	}
 
 	secrets = nm_setting_to_hash (NM_SETTING (setting));

Modified: trunk/src/connection-editor/nm-connection-list.c
==============================================================================
--- trunk/src/connection-editor/nm-connection-list.c	(original)
+++ trunk/src/connection-editor/nm-connection-list.c	Sun Oct 26 22:02:33 2008
@@ -836,7 +836,9 @@
 
 			type_setting = nm_setting_cdma_new ();
 			s_cdma = NM_SETTING_CDMA (type_setting);
-			s_cdma->number = g_strdup ("#777"); /* De-facto standard for CDMA */
+
+			/* De-facto standard for CDMA */
+			g_object_set (s_cdma, NM_SETTING_CDMA_NUMBER, "#777", NULL);
 
 			nm_connection_add_setting (connection, nm_setting_ppp_new ());
 		} else {

Modified: trunk/src/connection-editor/page-mobile.c
==============================================================================
--- trunk/src/connection-editor/page-mobile.c	(original)
+++ trunk/src/connection-editor/page-mobile.c	Sun Oct 26 22:02:33 2008
@@ -189,17 +189,21 @@
 	NMSettingCdma *setting = NM_SETTING_CDMA (priv->setting);
 	GHashTable *secrets;
 	GValue *value;
+	const char *s;
 
-	if (setting->number)
-		gtk_entry_set_text (priv->number, setting->number);
-
-	if (setting->username)
-		gtk_entry_set_text (priv->username, setting->username);
+	s = nm_setting_cdma_get_number (setting);
+	if (s)
+		gtk_entry_set_text (priv->number, s);
+
+	s = nm_setting_cdma_get_username (setting);
+	if (s)
+		gtk_entry_set_text (priv->username, s);
 
 	secrets = get_secrets (connection, nm_setting_get_name (priv->setting));
 
-	if (setting->password)
-		gtk_entry_set_text (priv->password, setting->password);
+	s = nm_setting_cdma_get_password (setting);
+	if (s)
+		gtk_entry_set_text (priv->password, s);
 	else if (secrets) {
 		value = g_hash_table_lookup (secrets, NM_SETTING_CDMA_PASSWORD);
 		if (value)



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