summary refs log tree commit diff
path: root/src/settings/plugins/example/nm-example-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/plugins/example/nm-example-connection.c')
-rw-r--r--src/settings/plugins/example/nm-example-connection.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/settings/plugins/example/nm-example-connection.c b/src/settings/plugins/example/nm-example-connection.c
index e2226829..2f0b20a0 100644
--- a/src/settings/plugins/example/nm-example-connection.c
+++ b/src/settings/plugins/example/nm-example-connection.c
@@ -18,9 +18,11 @@
  * Copyright (C) 2012 Red Hat, Inc.
  */
 
+#include "config.h"
+
 #include <string.h>
 #include <glib/gstdio.h>
-#include <NetworkManager.h>
+#include <nm-dbus-interface.h>
 #include <nm-setting-connection.h>
 #include <nm-utils.h>
 
@@ -89,7 +91,7 @@ nm_example_connection_new (const char *full_path,
 	/* Make sure we have a UUID; just a sanity check */
 	uuid = nm_connection_get_uuid (NM_CONNECTION (object));
 	if (!uuid) {
-		g_set_error (error, EXAMPLE_PLUGIN_ERROR, 0,
+		g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
 		             "Connection in file %s had no UUID", full_path);
 		g_object_unref (object);
 		object = NULL;
@@ -165,12 +167,7 @@ nm_example_connection_init (NMExampleConnection *connection)
 static void
 finalize (GObject *object)
 {
-	NMExampleConnectionPrivate *priv = NM_EXAMPLE_CONNECTION_GET_PRIVATE (object);
-
-	/* Zero out any secrets so we don't leave them in memory */
-	nm_connection_clear_secrets (NM_CONNECTION (object));
-
-	g_free (priv->path);
+	g_free (NM_EXAMPLE_CONNECTION_GET_PRIVATE (object)->path);
 
 	G_OBJECT_CLASS (nm_example_connection_parent_class)->finalize (object);
 }