[network-manager-applet] wifi: don't require a full connection for the wireless dialog (bgo #646210)



commit 9588f4a005075dfc7baa4e02119b2aa68036faa6
Author: Dan Williams <dcbw redhat com>
Date:   Sun Apr 17 10:03:07 2011 -0500

    wifi: don't require a full connection for the wireless dialog (bgo #646210)
    
    We won't always have a full one when creating a new connection since
    NM will fill the rest in for us.

 src/wireless-dialog.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/wireless-dialog.c b/src/wireless-dialog.c
index adce75b..5788b44 100644
--- a/src/wireless-dialog.c
+++ b/src/wireless-dialog.c
@@ -436,11 +436,16 @@ connection_combo_init (NMAWirelessDialog *self, NMConnection *connection)
 	priv->connection_model = GTK_TREE_MODEL (store);
 
 	if (connection) {
-		s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
+		s_con = nm_connection_get_setting_connection (connection);
 		g_assert (s_con);
-
 		id = nm_setting_connection_get_id (s_con);
-		g_assert (id);
+		if (id == NULL) {
+			/* New connections which will be completed by NM won't have an ID
+			 * yet, but that doesn't matter because we don't show the connection
+			 * combo anyway when there's a predefined connection.
+			 */
+			id = "blahblah";
+		}
 
 		gtk_list_store_append (store, &tree_iter);
 		gtk_list_store_set (store, &tree_iter,



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