summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-wimax.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-01-11 08:32:54 +0100
committerThomas Haller <thaller@redhat.com>2019-01-15 09:55:24 +0100
commit19141ef770f3064383b97f29a22440d58bdf7bc8 (patch)
tree00ecb5d9955ef8c334a2077cd294a31bb7285c55 /libnm-core/nm-setting-wimax.c
parenta3d6976efcb0b05fe304643c466df12b5ee56f9d (diff)
downloadNetworkManager-19141ef770f3064383b97f29a22440d58bdf7bc8.tar.gz
libnm-core: reorder code in settings
Order the code in our common way. No other changes. - ensure to include the main header first (directly after "nm-default.h"). - reorder function definitions: get_property(), set_property(), *_init(), *_new(), finalize(), *_class_init().
Diffstat (limited to 'libnm-core/nm-setting-wimax.c')
-rw-r--r--libnm-core/nm-setting-wimax.c101
1 files changed, 55 insertions, 46 deletions
diff --git a/libnm-core/nm-setting-wimax.c b/libnm-core/nm-setting-wimax.c
index f2351c7e99..aa574a56de 100644
--- a/libnm-core/nm-setting-wimax.c
+++ b/libnm-core/nm-setting-wimax.c
@@ -22,10 +22,11 @@
#include "nm-default.h"
+#include "nm-setting-wimax.h"
+
#include <string.h>
#include <net/ethernet.h>
-#include "nm-setting-wimax.h"
#include "nm-setting-private.h"
#include "nm-utils.h"
#include "nm-utils-private.h"
@@ -42,34 +43,23 @@
* connections cannot be activated.
**/
-G_DEFINE_TYPE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)
+/*****************************************************************************/
-#define NM_SETTING_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
+NM_GOBJECT_PROPERTIES_DEFINE_BASE (
+ PROP_NETWORK_NAME,
+ PROP_MAC_ADDRESS,
+);
typedef struct {
char *network_name;
char *mac_address;
} NMSettingWimaxPrivate;
-NM_GOBJECT_PROPERTIES_DEFINE_BASE (
- PROP_NETWORK_NAME,
- PROP_MAC_ADDRESS,
-);
+G_DEFINE_TYPE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)
-/**
- * nm_setting_wimax_new:
- *
- * Creates a new #NMSettingWimax object with default values.
- *
- * Returns: the new empty #NMSettingWimax object
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-NMSetting *
-nm_setting_wimax_new (void)
-{
- return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIMAX, NULL);
-}
+#define NM_SETTING_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
+
+/*****************************************************************************/
/**
* nm_setting_wimax_get_network_name:
@@ -144,20 +134,25 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
return TRUE;
}
-static void
-nm_setting_wimax_init (NMSettingWimax *setting)
-{
-}
+/*****************************************************************************/
static void
-finalize (GObject *object)
+get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
{
- NMSettingWimaxPrivate *priv = NM_SETTING_WIMAX_GET_PRIVATE (object);
-
- g_free (priv->network_name);
- g_free (priv->mac_address);
+ NMSettingWimax *setting = NM_SETTING_WIMAX (object);
- G_OBJECT_CLASS (nm_setting_wimax_parent_class)->finalize (object);
+ switch (prop_id) {
+ case PROP_NETWORK_NAME:
+ g_value_set_string (value, nm_setting_wimax_get_network_name (setting));
+ break;
+ case PROP_MAC_ADDRESS:
+ g_value_set_string (value, nm_setting_wimax_get_mac_address (setting));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
static void
@@ -182,23 +177,37 @@ set_property (GObject *object, guint prop_id,
}
}
+/*****************************************************************************/
+
static void
-get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
+nm_setting_wimax_init (NMSettingWimax *setting)
{
- NMSettingWimax *setting = NM_SETTING_WIMAX (object);
+}
- switch (prop_id) {
- case PROP_NETWORK_NAME:
- g_value_set_string (value, nm_setting_wimax_get_network_name (setting));
- break;
- case PROP_MAC_ADDRESS:
- g_value_set_string (value, nm_setting_wimax_get_mac_address (setting));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+/**
+ * nm_setting_wimax_new:
+ *
+ * Creates a new #NMSettingWimax object with default values.
+ *
+ * Returns: the new empty #NMSettingWimax object
+ *
+ * Deprecated: 1.2: WiMAX is no longer supported.
+ **/
+NMSetting *
+nm_setting_wimax_new (void)
+{
+ return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIMAX, NULL);
+}
+
+static void
+finalize (GObject *object)
+{
+ NMSettingWimaxPrivate *priv = NM_SETTING_WIMAX_GET_PRIVATE (object);
+
+ g_free (priv->network_name);
+ g_free (priv->mac_address);
+
+ G_OBJECT_CLASS (nm_setting_wimax_parent_class)->finalize (object);
}
static void
@@ -210,8 +219,8 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *klass)
g_type_class_add_private (klass, sizeof (NMSettingWimaxPrivate));
- object_class->set_property = set_property;
object_class->get_property = get_property;
+ object_class->set_property = set_property;
object_class->finalize = finalize;
setting_class->verify = verify;