NetworkManager r4192 - in trunk: . libnm-glib system-settings/plugins/ifupdown system-settings/plugins/keyfile



Author: dcbw
Date: Sat Oct 18 13:56:24 2008
New Revision: 4192
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4192&view=rev

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

	* libnm-glib/nm-settings.c
	  libnm-glib/nm-settings.h
		- Rename the "get_secrets" virtual function "service_get_secrets" to
			clarify when it's used; NMExportedConnetion is a base-class for both
			the client and service side, which is sort of confusing, and
			get_secrets only makes sense on the service side.

	* libnm-glib/nm-dbus-connection.c
		- (get_secrets): remove, unused, and clients need to do extra work to
			get secrets anyway since the call can block on the remote side

	* system-settings/plugins/ifupdown/nm-ifupdown-connection.c
	  system-settings/plugins/keyfile/nm-keyfile-connection.c
		- Fix up for get_secrets -> service_get_secrets



Modified:
   trunk/ChangeLog
   trunk/libnm-glib/nm-dbus-connection.c
   trunk/libnm-glib/nm-settings.c
   trunk/libnm-glib/nm-settings.h
   trunk/system-settings/plugins/ifupdown/nm-ifupdown-connection.c
   trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c

Modified: trunk/libnm-glib/nm-dbus-connection.c
==============================================================================
--- trunk/libnm-glib/nm-dbus-connection.c	(original)
+++ trunk/libnm-glib/nm-dbus-connection.c	Sat Oct 18 13:56:24 2008
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 
 #include <string.h>
 #include <NetworkManager.h>
@@ -52,17 +52,6 @@
 	return nm_connection_to_hash (nm_exported_connection_get_connection (exported));
 }
 
-static void
-get_secrets (NMExportedConnection *connection,
-		   const gchar *setting_name,
-		   const gchar **hints,
-		   gboolean request_new,
-		   DBusGMethodInvocation *context)
-{
-	/* FIXME: */
-	g_warning ("Implement me");
-}
-
 static gboolean
 update (NMExportedConnection *exported, GHashTable *new_settings, GError **err)
 {
@@ -273,7 +262,6 @@
 	object_class->finalize     = finalize;
 
 	connection_class->get_settings = get_settings;
-	connection_class->get_secrets  = get_secrets;
 	connection_class->update       = update;
 	connection_class->delete       = delete;
 

Modified: trunk/libnm-glib/nm-settings.c
==============================================================================
--- trunk/libnm-glib/nm-settings.c	(original)
+++ trunk/libnm-glib/nm-settings.c	Sat Oct 18 13:56:24 2008
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 
 #include <NetworkManager.h>
 #include <nm-utils.h>
@@ -157,10 +157,10 @@
 									    DBusGMethodInvocation *context);
 
 static void impl_exported_connection_get_secrets (NMExportedConnection *connection,
-						      const gchar *setting_name,
-						      const gchar **hints,
-						      gboolean request_new,
-						      DBusGMethodInvocation *context);
+                                                  const gchar *setting_name,
+                                                  const gchar **hints,
+                                                  gboolean request_new,
+                                                  DBusGMethodInvocation *context);
 
 #include "nm-exported-connection-glue.h"
 
@@ -277,23 +277,23 @@
 
 	if (!NM_IS_EXPORTED_CONNECTION (connection)) {
 		g_set_error (&error, NM_SETTINGS_ERROR, 1,
-		             "%s.%d - Invalid connection in ConnectionSettings::get_secrets.",
+		             "%s.%d - Invalid connection in ConnectionSettings::GetSecrets.",
 		             __FILE__, __LINE__);
 		dbus_g_method_return_error (context, error);
 		g_error_free (error);
 		return;
 	}
 
-	if (!EXPORTED_CONNECTION_CLASS (connection)->get_secrets) {
+	if (!EXPORTED_CONNECTION_CLASS (connection)->service_get_secrets) {
 		g_set_error (&error, NM_SETTINGS_ERROR, 1,
-		             "%s.%d - Missing implementation for ConnectionSettings::get_secrets.",
+		             "%s.%d - Missing implementation for ConnectionSettings::GetSecrets.",
 		             __FILE__, __LINE__);
 		dbus_g_method_return_error (context, error);
 		g_error_free (error);
 		return;
 	}
 
-	EXPORTED_CONNECTION_CLASS (connection)->get_secrets (connection, setting_name, hints, request_new, context);
+	EXPORTED_CONNECTION_CLASS (connection)->service_get_secrets (connection, setting_name, hints, request_new, context);
 }
 
 static void
@@ -366,9 +366,6 @@
 	object_class->get_property = get_property;
 	object_class->dispose = nm_exported_connection_dispose;
 
-	exported_connection_class->get_settings = NULL;
-	exported_connection_class->get_secrets = NULL;
-
 	/* Properties */
 	g_object_class_install_property
 		(object_class, PROP_CONNECTION,

Modified: trunk/libnm-glib/nm-settings.h
==============================================================================
--- trunk/libnm-glib/nm-settings.h	(original)
+++ trunk/libnm-glib/nm-settings.h	Sat Oct 18 13:56:24 2008
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 
 #ifndef __NM_SETTINGS_H__
 #define __NM_SETTINGS_H__
@@ -33,22 +33,26 @@
 
 	/* virtual methods */
 	GHashTable * (*get_settings) (NMExportedConnection *connection);
-	void         (*get_secrets) (NMExportedConnection *connection,
-	                             const gchar *setting_name,
-	                             const gchar **hints,
-	                             gboolean request_new,
-	                             DBusGMethodInvocation *context);
+
+	/* service_get_secrets is used in a D-Bus service (like the system settings
+	 * service) to respond to GetSecrets requests from clients.
+	 */
+	void         (*service_get_secrets) (NMExportedConnection *connection,
+	                                     const gchar *setting_name,
+	                                     const gchar **hints,
+	                                     gboolean request_new,
+	                                     DBusGMethodInvocation *context);
 
 	gboolean (*update) (NMExportedConnection *connection,
-					GHashTable *new_settings,
-					GError **err);
+	                    GHashTable *new_settings,
+	                    GError **err);
 
 	gboolean (*delete) (NMExportedConnection *connection,
-					GError **err);
+	                    GError **err);
 
 	/* signals */
-	void (* updated) (NMExportedConnection *connection, GHashTable *settings);
-	void (* removed) (NMExportedConnection *connection);
+	void (*updated) (NMExportedConnection *connection, GHashTable *settings);
+	void (*removed) (NMExportedConnection *connection);
 } NMExportedConnectionClass;
 
 GType nm_exported_connection_get_type (void);

Modified: trunk/system-settings/plugins/ifupdown/nm-ifupdown-connection.c
==============================================================================
--- trunk/system-settings/plugins/ifupdown/nm-ifupdown-connection.c	(original)
+++ trunk/system-settings/plugins/ifupdown/nm-ifupdown-connection.c	Sat Oct 18 13:56:24 2008
@@ -49,11 +49,11 @@
 
 
 static void
-get_secrets (NMExportedConnection *exported,
-		   const gchar *setting_name,
-		   const gchar **hints,
-		   gboolean request_new,
-		   DBusGMethodInvocation *context);
+service_get_secrets (NMExportedConnection *exported,
+                     const gchar *setting_name,
+                     const gchar **hints,
+                     gboolean request_new,
+                     DBusGMethodInvocation *context);
 
 
 NMIfupdownConnection*
@@ -187,7 +187,7 @@
 	connection_class->get_settings = get_settings;
 	connection_class->update       = update;
 	connection_class->delete       = delete;
-	connection_class->get_secrets       = get_secrets;
+	connection_class->service_get_secrets = service_get_secrets;
 
 	/* Properties */
 	g_object_class_install_property
@@ -199,11 +199,11 @@
 }
 
 static void
-get_secrets (NMExportedConnection *exported,
-		   const gchar *setting_name,
-		   const gchar **hints,
-		   gboolean request_new,
-		   DBusGMethodInvocation *context)
+service_get_secrets (NMExportedConnection *exported,
+                     const gchar *setting_name,
+                     const gchar **hints,
+                     gboolean request_new,
+                     DBusGMethodInvocation *context)
 {
 	NMConnection *connection;
 	GError *error = NULL;

Modified: trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c
==============================================================================
--- trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c	(original)
+++ trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c	Sat Oct 18 13:56:24 2008
@@ -137,11 +137,11 @@
 }
 
 static void
-get_secrets (NMExportedConnection *exported,
-             const gchar *setting_name,
-             const gchar **hints,
-             gboolean request_new,
-             DBusGMethodInvocation *context)
+service_get_secrets (NMExportedConnection *exported,
+                     const gchar *setting_name,
+                     const gchar **hints,
+                     gboolean request_new,
+                     DBusGMethodInvocation *context)
 {
 	NMConnection *connection;
 	GError *error = NULL;
@@ -338,7 +338,7 @@
 	object_class->finalize     = finalize;
 
 	connection_class->get_settings = get_settings;
-	connection_class->get_secrets  = get_secrets;
+	connection_class->service_get_secrets  = service_get_secrets;
 	connection_class->update       = update;
 	connection_class->delete       = delete;
 



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