about summary refs log tree commit diff
path: root/libnm-core/nm-simple-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/nm-simple-connection.c')
-rw-r--r--libnm-core/nm-simple-connection.c94
1 files changed, 48 insertions, 46 deletions
diff --git a/libnm-core/nm-simple-connection.c b/libnm-core/nm-simple-connection.c
index fd7eb870..41ba018f 100644
--- a/libnm-core/nm-simple-connection.c
+++ b/libnm-core/nm-simple-connection.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: LGPL-2.1+
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /*
  * Copyright (C) 2007 - 2008 Novell, Inc.
  * Copyright (C) 2007 - 2014 Red Hat, Inc.
@@ -20,18 +20,19 @@
 
 /*****************************************************************************/
 
-static void nm_simple_connection_interface_init (NMConnectionInterface *iface);
+static void nm_simple_connection_interface_init(NMConnectionInterface *iface);
 
-G_DEFINE_TYPE_WITH_CODE (NMSimpleConnection, nm_simple_connection, G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (NM_TYPE_CONNECTION, nm_simple_connection_interface_init);
-                         )
+G_DEFINE_TYPE_WITH_CODE(NMSimpleConnection,
+                        nm_simple_connection,
+                        G_TYPE_OBJECT,
+                        G_IMPLEMENT_INTERFACE(NM_TYPE_CONNECTION,
+                                              nm_simple_connection_interface_init);)
 
 /*****************************************************************************/
 
 static void
-nm_simple_connection_init (NMSimpleConnection *self)
-{
-}
+nm_simple_connection_init(NMSimpleConnection *self)
+{}
 
 /**
  * nm_simple_connection_new:
@@ -41,9 +42,9 @@ nm_simple_connection_init (NMSimpleConnection *self)
  * Returns: (transfer full): the new empty #NMConnection object
  **/
 NMConnection *
-nm_simple_connection_new (void)
+nm_simple_connection_new(void)
 {
-	return (NMConnection *) g_object_new (NM_TYPE_SIMPLE_CONNECTION, NULL);
+    return (NMConnection *) g_object_new(NM_TYPE_SIMPLE_CONNECTION, NULL);
 }
 
 /**
@@ -60,19 +61,22 @@ nm_simple_connection_new (void)
  * an error.
  **/
 NMConnection *
-_nm_simple_connection_new_from_dbus (GVariant *dict, NMSettingParseFlags parse_flags, GError **error)
+_nm_simple_connection_new_from_dbus(GVariant *dict, NMSettingParseFlags parse_flags, GError **error)
 {
-	NMConnection *connection;
-
-	g_return_val_if_fail (dict != NULL, NULL);
-	g_return_val_if_fail (g_variant_is_of_type (dict, NM_VARIANT_TYPE_CONNECTION), NULL);
-	g_return_val_if_fail (!NM_FLAGS_ANY (parse_flags, ~NM_SETTING_PARSE_FLAGS_ALL), NULL);
-	g_return_val_if_fail (!NM_FLAGS_ALL (parse_flags, NM_SETTING_PARSE_FLAGS_STRICT | NM_SETTING_PARSE_FLAGS_BEST_EFFORT), NULL);
-
-	connection = nm_simple_connection_new ();
-	if (!_nm_connection_replace_settings (connection, dict, parse_flags, error))
-		g_clear_object (&connection);
-	return connection;
+    NMConnection *connection;
+
+    g_return_val_if_fail(dict != NULL, NULL);
+    g_return_val_if_fail(g_variant_is_of_type(dict, NM_VARIANT_TYPE_CONNECTION), NULL);
+    g_return_val_if_fail(!NM_FLAGS_ANY(parse_flags, ~NM_SETTING_PARSE_FLAGS_ALL), NULL);
+    g_return_val_if_fail(
+        !NM_FLAGS_ALL(parse_flags,
+                      NM_SETTING_PARSE_FLAGS_STRICT | NM_SETTING_PARSE_FLAGS_BEST_EFFORT),
+        NULL);
+
+    connection = nm_simple_connection_new();
+    if (!_nm_connection_replace_settings(connection, dict, parse_flags, error))
+        g_clear_object(&connection);
+    return connection;
 }
 
 /**
@@ -89,11 +93,9 @@ _nm_simple_connection_new_from_dbus (GVariant *dict, NMSettingParseFlags parse_f
  * connection failed to normalize.
  **/
 NMConnection *
-nm_simple_connection_new_from_dbus (GVariant *dict, GError **error)
+nm_simple_connection_new_from_dbus(GVariant *dict, GError **error)
 {
-	return _nm_simple_connection_new_from_dbus (dict,
-	                                            NM_SETTING_PARSE_FLAGS_NORMALIZE,
-	                                            error);
+    return _nm_simple_connection_new_from_dbus(dict, NM_SETTING_PARSE_FLAGS_NORMALIZE, error);
 }
 
 /**
@@ -106,45 +108,45 @@ nm_simple_connection_new_from_dbus (GVariant *dict, GError **error)
  * and properties as the source #NMConnection
  **/
 NMConnection *
-nm_simple_connection_new_clone (NMConnection *connection)
+nm_simple_connection_new_clone(NMConnection *connection)
 {
-	NMConnection *clone;
-	const char *path;
+    NMConnection *clone;
+    const char *  path;
 
-	g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
+    g_return_val_if_fail(NM_IS_CONNECTION(connection), NULL);
 
-	clone = nm_simple_connection_new ();
+    clone = nm_simple_connection_new();
 
-	path = nm_connection_get_path (connection);
-	if (path)
-		nm_connection_set_path (clone, path);
+    path = nm_connection_get_path(connection);
+    if (path)
+        nm_connection_set_path(clone, path);
 
-	nm_connection_replace_settings_from_connection (clone, connection);
+    nm_connection_replace_settings_from_connection(clone, connection);
 
-	return clone;
+    return clone;
 }
 
 static void
-dispose (GObject *object)
+dispose(GObject *object)
 {
 #if NM_MORE_ASSERTS
-	g_signal_handlers_disconnect_by_data (object, (gpointer) &_nmtst_connection_unchanging_user_data);
+    g_signal_handlers_disconnect_by_data(object,
+                                         (gpointer) &_nmtst_connection_unchanging_user_data);
 #endif
 
-	nm_connection_clear_secrets (NM_CONNECTION (object));
+    nm_connection_clear_secrets(NM_CONNECTION(object));
 
-	G_OBJECT_CLASS (nm_simple_connection_parent_class)->dispose (object);
+    G_OBJECT_CLASS(nm_simple_connection_parent_class)->dispose(object);
 }
 
 static void
-nm_simple_connection_class_init (NMSimpleConnectionClass *simple_class)
+nm_simple_connection_class_init(NMSimpleConnectionClass *simple_class)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (simple_class);
+    GObjectClass *object_class = G_OBJECT_CLASS(simple_class);
 
-	object_class->dispose = dispose;
+    object_class->dispose = dispose;
 }
 
 static void
-nm_simple_connection_interface_init (NMConnectionInterface *iface)
-{
-}
+nm_simple_connection_interface_init(NMConnectionInterface *iface)
+{}