NetworkManager r3736 - in trunk: . src



Author: dcbw
Date: Tue Jun 10 02:02:21 2008
New Revision: 3736
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3736&view=rev

Log:
2008-06-09  Dan Williams  <dcbw redhat com>

	* src/nm-activation-request.c
	  src/nm-activation-request.h
		- (nm_act_request_set_shared, nm_act_request_get_shared,
		   nm_act_request_get_device): new functions to facilitate connection
			sharing



Modified:
   trunk/ChangeLog
   trunk/src/nm-activation-request.c
   trunk/src/nm-activation-request.h

Modified: trunk/src/nm-activation-request.c
==============================================================================
--- trunk/src/nm-activation-request.c	(original)
+++ trunk/src/nm-activation-request.c	Tue Jun 10 02:02:21 2008
@@ -55,12 +55,13 @@
 typedef struct {
 	NMConnection *connection;
 	char *specific_object;
-	NMConnection *shared;
+	NMConnection *shared_connection;
 	NMDevice *device;
 	gboolean user_requested;
 
 	NMActiveConnectionState state;
 	gboolean is_default;
+	gboolean shared;
 
 	char *ac_path;
 } NMActRequestPrivate;
@@ -157,8 +158,8 @@
 	                   CONNECTION_GET_SECRETS_CALL_TAG, NULL);
 	g_object_unref (priv->connection);
 
-	if (priv->shared)
-		g_object_unref (priv->shared);
+	if (priv->shared_connection)
+		g_object_unref (priv->shared_connection);
 
 out:
 	G_OBJECT_CLASS (nm_act_request_parent_class)->dispose (object);
@@ -196,11 +197,11 @@
 			g_value_set_boxed (value, "/");
 		break;
 	case PROP_SHARED_SERVICE_NAME:
-		nm_active_connection_scope_to_value (priv->shared, value);
+		nm_active_connection_scope_to_value (priv->shared_connection, value);
 		break;
 	case PROP_SHARED_CONNECTION:
-		if (priv->shared)
-			g_value_set_boxed (value, nm_connection_get_path (priv->shared));
+		if (priv->shared_connection)
+			g_value_set_boxed (value, nm_connection_get_path (priv->shared_connection));
 		else
 			g_value_set_boxed (value, "/");
 		break;
@@ -652,3 +653,27 @@
 	return NM_ACT_REQUEST_GET_PRIVATE (req)->is_default;
 }
 
+void
+nm_act_request_set_shared (NMActRequest *req, gboolean shared)
+{
+	g_return_if_fail (NM_IS_ACT_REQUEST (req));
+
+	NM_ACT_REQUEST_GET_PRIVATE (req)->shared = shared;
+}
+
+gboolean
+nm_act_request_get_shared (NMActRequest *req)
+{
+	g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
+
+	return NM_ACT_REQUEST_GET_PRIVATE (req)->shared;
+}
+
+GObject *
+nm_act_request_get_device (NMActRequest *req)
+{
+	g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
+
+	return G_OBJECT (NM_ACT_REQUEST_GET_PRIVATE (req)->device);
+}
+

Modified: trunk/src/nm-activation-request.h
==============================================================================
--- trunk/src/nm-activation-request.h	(original)
+++ trunk/src/nm-activation-request.h	Tue Jun 10 02:02:21 2008
@@ -76,4 +76,10 @@
 
 gboolean      nm_act_request_get_default (NMActRequest *req);
 
+gboolean      nm_act_request_get_shared (NMActRequest *req);
+
+void          nm_act_request_set_shared (NMActRequest *req, gboolean shared);
+
+GObject *     nm_act_request_get_device (NMActRequest *req);
+
 #endif /* NM_ACTIVATION_REQUEST_H */



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