core: fix setting device type during device creation

This commit is contained in:
Dan Williams
2009-07-07 22:25:58 -04:00
parent b62ff36e33
commit be9bc944d4
2 changed files with 5 additions and 1 deletions

View File

@@ -137,7 +137,7 @@ nm_device_interface_init (gpointer g_iface)
"DeviceType",
"DeviceType",
0, G_MAXUINT32, NM_DEVICE_TYPE_UNKNOWN,
G_PARAM_READABLE));
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_interface_install_property
(g_iface, g_param_spec_boolean (NM_DEVICE_INTERFACE_MANAGED,

View File

@@ -2248,6 +2248,10 @@ set_property (GObject *object, guint prop_id,
case NM_DEVICE_INTERFACE_PROP_MANAGED:
priv->managed = g_value_get_boolean (value);
break;
case NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE:
g_return_if_fail (priv->type == NM_DEVICE_TYPE_UNKNOWN);
priv->type = g_value_get_uint (value);
break;
case NM_DEVICE_INTERFACE_PROP_TYPE_DESC:
g_free (priv->type_desc);
priv->type_desc = g_value_dup_string (value);