network-manager-applet r1099 - in branches/NETWORKMANAGER_APPLET_0_7: . src/gconf-helpers



Author: dcbw
Date: Fri Jan 16 20:05:30 2009
New Revision: 1099
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=1099&view=rev

Log:
2008-01-16  Tambet Ingo  <tambet gmail com>

	* src/gconf-helpers/nma-gconf-settings.c
		- (connection_changes_done, add_connection_real, connection_removed):
			fix handling of connections removed from GConf by external programs
			(bgo #557590)



Modified:
   branches/NETWORKMANAGER_APPLET_0_7/ChangeLog
   branches/NETWORKMANAGER_APPLET_0_7/src/gconf-helpers/nma-gconf-settings.c

Modified: branches/NETWORKMANAGER_APPLET_0_7/src/gconf-helpers/nma-gconf-settings.c
==============================================================================
--- branches/NETWORKMANAGER_APPLET_0_7/src/gconf-helpers/nma-gconf-settings.c	(original)
+++ branches/NETWORKMANAGER_APPLET_0_7/src/gconf-helpers/nma-gconf-settings.c	Fri Jan 16 20:05:30 2009
@@ -78,6 +78,15 @@
 }
 
 static void
+connection_removed (NMExportedConnection *connection, gpointer user_data)
+{
+	NMAGConfSettingsPrivate *priv = NMA_GCONF_SETTINGS_GET_PRIVATE (user_data);
+
+	priv->connections = g_slist_remove (priv->connections, connection);
+	g_object_unref (connection);
+}
+
+static void
 add_connection_real (NMAGConfSettings *self, NMAGConfConnection *connection)
 {
 	NMAGConfSettingsPrivate *priv = NMA_GCONF_SETTINGS_GET_PRIVATE (self);
@@ -88,6 +97,7 @@
 					   G_CALLBACK (connection_new_secrets_requested_cb),
 					   self);
 
+		g_signal_connect (connection, "removed", G_CALLBACK (connection_removed), self);
 		nm_settings_signal_new_connection (NM_SETTINGS (self),
 									NM_EXPORTED_CONNECTION (connection));
 	}
@@ -281,14 +291,7 @@
 	if (!connection) {
 		/* New connection */
 		connection = nma_gconf_connection_new (priv->client, info->path);
-		if (connection) {
-			g_signal_connect (connection, "new-secrets-requested",
-						   G_CALLBACK (connection_new_secrets_requested_cb),
-						   info->settings);
-			priv->connections = g_slist_append (priv->connections, connection);
-			nm_settings_signal_new_connection (NM_SETTINGS (info->settings),
-										NM_EXPORTED_CONNECTION (connection));
-		}
+		add_connection_real (info->settings, connection);
 	} else {
 		if (gconf_client_dir_exists (priv->client, info->path, NULL)) {
 			/* Updated connection */



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