Commit a3d6976e authored by Thomas Haller's avatar Thomas Haller

libnm-core: cleanup NMSetting's class initialization

Unify the coding style for class-init functions in libnm-core.

Also make use of obj_properties, NM_GOBJECT_PROPERTIES_DEFINE(), and
_notify().
parent 450a471d
......@@ -3006,8 +3006,6 @@ nm_connection_get_private (NMConnection *connection)
static void
nm_connection_default_init (NMConnectionInterface *iface)
{
/* Signals */
/**
* NMConnection::secrets-updated:
* @connection: the object on which the signal is emitted
......@@ -3018,14 +3016,14 @@ nm_connection_default_init (NMConnectionInterface *iface)
* have been changed.
*/
signals[SECRETS_UPDATED] =
g_signal_new (NM_CONNECTION_SECRETS_UPDATED,
NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMConnectionInterface, secrets_updated),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
g_signal_new (NM_CONNECTION_SECRETS_UPDATED,
NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMConnectionInterface, secrets_updated),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
/**
* NMConnection::secrets-cleared:
......@@ -3035,13 +3033,13 @@ nm_connection_default_init (NMConnectionInterface *iface)
* are cleared.
*/
signals[SECRETS_CLEARED] =
g_signal_new (NM_CONNECTION_SECRETS_CLEARED,
NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMConnectionInterface, secrets_cleared),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_signal_new (NM_CONNECTION_SECRETS_CLEARED,
NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMConnectionInterface, secrets_cleared),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* NMConnection::changed:
......@@ -3052,11 +3050,11 @@ nm_connection_default_init (NMConnectionInterface *iface)
* or when settings are added or removed.
*/
signals[CHANGED] =
g_signal_new (NM_CONNECTION_CHANGED,
NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMConnectionInterface, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_signal_new (NM_CONNECTION_CHANGED,
NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (NMConnectionInterface, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
......@@ -51,8 +51,7 @@ typedef struct {
guint32 vci;
} NMSettingAdslPrivate;
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_USERNAME,
PROP_PASSWORD,
PROP_PASSWORD_FLAGS,
......@@ -60,9 +59,7 @@ enum {
PROP_ENCAPSULATION,
PROP_VPI,
PROP_VCI,
LAST_PROP
};
);
/**
* nm_setting_adsl_new:
......@@ -364,86 +361,81 @@ nm_setting_adsl_class_init (NMSettingAdslClass *klass)
*
* Username used to authenticate with the ADSL service.
**/
g_object_class_install_property
(object_class, PROP_USERNAME,
g_param_spec_string (NM_SETTING_ADSL_USERNAME, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_USERNAME] =
g_param_spec_string (NM_SETTING_ADSL_USERNAME, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingAdsl:password:
*
* Password used to authenticate with the ADSL service.
**/
g_object_class_install_property
(object_class, PROP_PASSWORD,
g_param_spec_string (NM_SETTING_ADSL_PASSWORD, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_SECRET |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PASSWORD] =
g_param_spec_string (NM_SETTING_ADSL_PASSWORD, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_SECRET |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingAdsl:password-flags:
*
* Flags indicating how to handle the #NMSettingAdsl:password property.
**/
g_object_class_install_property
(object_class, PROP_PASSWORD_FLAGS,
g_param_spec_flags (NM_SETTING_ADSL_PASSWORD_FLAGS, "", "",
NM_TYPE_SETTING_SECRET_FLAGS,
NM_SETTING_SECRET_FLAG_NONE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PASSWORD_FLAGS] =
g_param_spec_flags (NM_SETTING_ADSL_PASSWORD_FLAGS, "", "",
NM_TYPE_SETTING_SECRET_FLAGS,
NM_SETTING_SECRET_FLAG_NONE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingAdsl:protocol:
*
* ADSL connection protocol. Can be "pppoa", "pppoe" or "ipoatm".
**/
g_object_class_install_property
(object_class, PROP_PROTOCOL,
g_param_spec_string (NM_SETTING_ADSL_PROTOCOL, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PROTOCOL] =
g_param_spec_string (NM_SETTING_ADSL_PROTOCOL, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingAdsl:encapsulation:
*
* Encapsulation of ADSL connection. Can be "vcmux" or "llc".
**/
g_object_class_install_property
(object_class, PROP_ENCAPSULATION,
g_param_spec_string (NM_SETTING_ADSL_ENCAPSULATION, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_ENCAPSULATION] =
g_param_spec_string (NM_SETTING_ADSL_ENCAPSULATION, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingAdsl:vpi:
*
* VPI of ADSL connection
**/
g_object_class_install_property
(object_class, PROP_VPI,
g_param_spec_uint (NM_SETTING_ADSL_VPI, "", "",
0, 65536, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_VPI] =
g_param_spec_uint (NM_SETTING_ADSL_VPI, "", "",
0, 65536, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingAdsl:vci:
*
* VCI of ADSL connection
**/
g_object_class_install_property
(object_class, PROP_VCI,
g_param_spec_uint (NM_SETTING_ADSL_VCI, "", "",
0, 65536, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_VCI] =
g_param_spec_uint (NM_SETTING_ADSL_VCI, "", "",
0, 65536, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_ADSL);
}
......@@ -52,13 +52,10 @@ typedef struct {
char *type;
} NMSettingBluetoothPrivate;
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_BDADDR,
PROP_TYPE,
LAST_PROP
};
);
/**
* nm_setting_bluetooth_new:
......@@ -300,17 +297,15 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
*
* The Bluetooth address of the device.
**/
g_object_class_install_property
(object_class, PROP_BDADDR,
g_param_spec_string (NM_SETTING_BLUETOOTH_BDADDR, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_BDADDR] =
g_param_spec_string (NM_SETTING_BLUETOOTH_BDADDR, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
_properties_override_add_transform (properties_override,
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
NM_SETTING_BLUETOOTH_BDADDR),
obj_properties[PROP_BDADDR],
G_VARIANT_TYPE_BYTESTRING,
_nm_utils_hwaddr_to_dbus,
_nm_utils_hwaddr_from_dbus);
......@@ -321,13 +316,14 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
* Either "dun" for Dial-Up Networking connections or "panu" for Personal
* Area Networking connections to devices supporting the NAP profile.
**/
g_object_class_install_property
(object_class, PROP_TYPE,
g_param_spec_string (NM_SETTING_BLUETOOTH_TYPE, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_TYPE] =
g_param_spec_string (NM_SETTING_BLUETOOTH_TYPE, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_BLUETOOTH,
NULL, properties_override);
......
......@@ -46,11 +46,9 @@
/*****************************************************************************/
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingBond,
PROP_OPTIONS,
LAST_PROP
};
);
typedef struct {
GHashTable *options;
......@@ -365,7 +363,7 @@ nm_setting_bond_add_option (NMSettingBond *setting,
g_hash_table_remove (priv->options, NM_SETTING_BOND_OPTION_UPDELAY);
}
g_object_notify (G_OBJECT (setting), NM_SETTING_BOND_OPTIONS);
_notify (setting, PROP_OPTIONS);
return TRUE;
}
......@@ -398,7 +396,7 @@ nm_setting_bond_remove_option (NMSettingBond *setting,
nm_clear_g_free (&priv->options_idx_cache);
found = g_hash_table_remove (priv->options, name);
if (found)
g_object_notify (G_OBJECT (setting), NM_SETTING_BOND_OPTIONS);
_notify (setting, PROP_OPTIONS);
return found;
}
......@@ -983,17 +981,15 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
* example: BONDING_OPTS="miimon=100 mode=broadcast"
* ---end---
*/
g_object_class_install_property
(object_class, PROP_OPTIONS,
g_param_spec_boxed (NM_SETTING_BOND_OPTIONS, "", "",
G_TYPE_HASH_TABLE,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_OPTIONS] =
g_param_spec_boxed (NM_SETTING_BOND_OPTIONS, "", "",
G_TYPE_HASH_TABLE,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
_properties_override_add_transform (properties_override,
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
NM_SETTING_BOND_OPTIONS),
obj_properties[PROP_OPTIONS],
G_VARIANT_TYPE ("a{ss}"),
_nm_utils_strdict_to_dbus,
_nm_utils_strdict_from_dbus);
......@@ -1012,6 +1008,8 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
_nm_setting_get_deprecated_virtual_interface_name,
NULL);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_BOND,
NULL, properties_override);
}
......@@ -50,13 +50,11 @@ typedef struct {
gboolean hairpin_mode;
} NMSettingBridgePortPrivate;
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_PRIORITY,
PROP_PATH_COST,
PROP_HAIRPIN_MODE,
LAST_PROP
};
);
/*****************************************************************************/
......@@ -229,14 +227,13 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass)
* description: STP priority.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY, "", "",
0, NM_BR_PORT_MAX_PRIORITY, NM_BR_PORT_DEF_PRIORITY,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PRIORITY] =
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY, "", "",
0, NM_BR_PORT_MAX_PRIORITY, NM_BR_PORT_DEF_PRIORITY,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridgePort:path-cost:
......@@ -252,13 +249,12 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass)
* description: STP cost.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_PATH_COST,
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST, "", "",
0, NM_BR_PORT_MAX_PATH_COST, 100,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PATH_COST] =
g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST, "", "",
0, NM_BR_PORT_MAX_PATH_COST, 100,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridgePort:hairpin-mode:
......@@ -273,13 +269,14 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass)
* description: Hairpin mode of the bridge port.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_HAIRPIN_MODE,
g_param_spec_boolean (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, "", "",
FALSE,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_HAIRPIN_MODE] =
g_param_spec_boolean (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, "", "",
FALSE,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_BRIDGE_PORT);
}
......@@ -54,8 +54,7 @@ typedef struct {
gboolean multicast_snooping;
} NMSettingBridgePrivate;
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_MAC_ADDRESS,
PROP_STP,
PROP_PRIORITY,
......@@ -65,8 +64,7 @@ enum {
PROP_AGEING_TIME,
PROP_GROUP_FORWARD_MASK,
PROP_MULTICAST_SNOOPING,
LAST_PROP
};
);
/**
* nm_setting_bridge_new:
......@@ -435,17 +433,15 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* BRIDGE_MACADDR for bridges is an NM extension.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_MAC_ADDRESS,
g_param_spec_string (NM_SETTING_BRIDGE_MAC_ADDRESS, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_MAC_ADDRESS] =
g_param_spec_string (NM_SETTING_BRIDGE_MAC_ADDRESS, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
_properties_override_add_transform (properties_override,
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
NM_SETTING_BRIDGE_MAC_ADDRESS),
obj_properties[PROP_MAC_ADDRESS],
G_VARIANT_TYPE_BYTESTRING,
_nm_utils_hwaddr_to_dbus,
_nm_utils_hwaddr_from_dbus);
......@@ -462,14 +458,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: Span tree protocol participation.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_STP,
g_param_spec_boolean (NM_SETTING_BRIDGE_STP, "", "",
TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_STP] =
g_param_spec_boolean (NM_SETTING_BRIDGE_STP, "", "",
TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:priority:
......@@ -486,14 +481,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: STP priority.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_PRIORITY,
g_param_spec_uint (NM_SETTING_BRIDGE_PRIORITY, "", "",
0, G_MAXUINT16, 0x8000,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PRIORITY] =
g_param_spec_uint (NM_SETTING_BRIDGE_PRIORITY, "", "",
0, G_MAXUINT16, 0x8000,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:forward-delay:
......@@ -508,14 +502,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: STP forwarding delay.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_FORWARD_DELAY,
g_param_spec_uint (NM_SETTING_BRIDGE_FORWARD_DELAY, "", "",
0, NM_BR_MAX_FORWARD_DELAY, 15,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_FORWARD_DELAY] =
g_param_spec_uint (NM_SETTING_BRIDGE_FORWARD_DELAY, "", "",
0, NM_BR_MAX_FORWARD_DELAY, 15,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:hello-time:
......@@ -530,14 +523,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: STP hello time.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_HELLO_TIME,
g_param_spec_uint (NM_SETTING_BRIDGE_HELLO_TIME, "", "",
0, NM_BR_MAX_HELLO_TIME, 2,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_HELLO_TIME] =
g_param_spec_uint (NM_SETTING_BRIDGE_HELLO_TIME, "", "",
0, NM_BR_MAX_HELLO_TIME, 2,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:max-age:
......@@ -552,14 +544,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: STP maximum message age.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_MAX_AGE,
g_param_spec_uint (NM_SETTING_BRIDGE_MAX_AGE, "", "",
0, NM_BR_MAX_MAX_AGE, 20,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_MAX_AGE] =
g_param_spec_uint (NM_SETTING_BRIDGE_MAX_AGE, "", "",
0, NM_BR_MAX_MAX_AGE, 20,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:ageing-time:
......@@ -574,14 +565,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: Ethernet MAC ageing time.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_AGEING_TIME,
g_param_spec_uint (NM_SETTING_BRIDGE_AGEING_TIME, "", "",
NM_BR_MIN_AGEING_TIME, NM_BR_MAX_AGEING_TIME, 300,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_AGEING_TIME] =
g_param_spec_uint (NM_SETTING_BRIDGE_AGEING_TIME, "", "",
NM_BR_MIN_AGEING_TIME, NM_BR_MAX_AGEING_TIME, 300,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:group-forward-mask:
......@@ -595,14 +585,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
*
* Since: 1.10
**/
g_object_class_install_property
(object_class, PROP_GROUP_FORWARD_MASK,
g_param_spec_uint (NM_SETTING_BRIDGE_GROUP_FORWARD_MASK, "", "",
0, 0xFFFF, 0,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_GROUP_FORWARD_MASK] =
g_param_spec_uint (NM_SETTING_BRIDGE_GROUP_FORWARD_MASK, "", "",
0, 0xFFFF, 0,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingBridge:multicast-snooping:
......@@ -622,14 +611,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
* description: IGMP snooping support.
* ---end---
*/
g_object_class_install_property
(object_class, PROP_MULTICAST_SNOOPING,
g_param_spec_boolean (NM_SETTING_BRIDGE_MULTICAST_SNOOPING, "", "",
TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_MULTICAST_SNOOPING] =
g_param_spec_boolean (NM_SETTING_BRIDGE_MULTICAST_SNOOPING, "", "",
TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS);
/* ---dbus---
* property: interface-name
......@@ -645,6 +633,8 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
_nm_setting_get_deprecated_virtual_interface_name,
NULL);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_BRIDGE,
NULL, properties_override);
}
......@@ -49,16 +49,13 @@ typedef struct {
guint32 mtu;
} NMSettingCdmaPrivate;
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_NUMBER,
PROP_USERNAME,
PROP_PASSWORD,
PROP_PASSWORD_FLAGS,
PROP_MTU,
LAST_PROP
};
);
/**
* nm_setting_cdma_new:
......@@ -305,12 +302,11 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass)
* broadband network, if any. If not specified, the default number (#777)
* is used when required.
**/
g_object_class_install_property
(object_class, PROP_NUMBER,
g_param_spec_string (NM_SETTING_CDMA_NUMBER, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_NUMBER] =
g_param_spec_string (NM_SETTING_CDMA_NUMBER, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingCdma:username:
......@@ -319,12 +315,11 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass)
* providers do not require a username, or accept any username. But if a
* username is required, it is specified here.
**/
g_object_class_install_property
(object_class, PROP_USERNAME,
g_param_spec_string (NM_SETTING_CDMA_USERNAME, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_USERNAME] =
g_param_spec_string (NM_SETTING_CDMA_USERNAME, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingCdma:password:
......@@ -333,26 +328,24 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass)
* providers do not require a password, or accept any password. But if a
* password is required, it is specified here.
**/
g_object_class_install_property
(object_class, PROP_PASSWORD,
g_param_spec_string (NM_SETTING_CDMA_PASSWORD, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_SECRET |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PASSWORD] =
g_param_spec_string (NM_SETTING_CDMA_PASSWORD, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_SECRET |
G_PARAM_STATIC_STRINGS);
/**
* NMSettingCdma:password-flags:
*
* Flags indicating how to handle the #NMSettingCdma:password property.
**/
g_object_class_install_property
(object_class, PROP_PASSWORD_FLAGS,
g_param_spec_flags (NM_SETTING_CDMA_PASSWORD_FLAGS, "", "",
NM_TYPE_SETTING_SECRET_FLAGS,
NM_SETTING_SECRET_FLAG_NONE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_PASSWORD_FLAGS] =
g_param_spec_flags (NM_SETTING_CDMA_PASSWORD_FLAGS, "", "",
NM_TYPE_SETTING_SECRET_FLAGS,
NM_SETTING_SECRET_FLAG_NONE,
G_PARAM_READWRITE |