mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
exported-object: fix adding get_property() function for "path" property
Fixes:e4e0daeed4
(cherry picked from commitaba850609b
)
This commit is contained in:
parent
183d49f759
commit
1b38632d5d
|
@ -970,6 +970,23 @@ vtype_found:
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMExportedObject *self = NM_EXPORTED_OBJECT (object);
|
||||||
|
NMExportedObjectPrivate *priv = NM_EXPORTED_OBJECT_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PATH:
|
||||||
|
g_value_set_string (value, priv->path);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_exported_object_init (NMExportedObject *self)
|
nm_exported_object_init (NMExportedObject *self)
|
||||||
{
|
{
|
||||||
|
@ -1008,7 +1025,7 @@ dispose (GObject *object)
|
||||||
if (!quitting) {
|
if (!quitting) {
|
||||||
if (priv->path) {
|
if (priv->path) {
|
||||||
g_warn_if_reached ();
|
g_warn_if_reached ();
|
||||||
nm_exported_object_unexport (NM_EXPORTED_OBJECT (object));
|
nm_exported_object_unexport (self);
|
||||||
}
|
}
|
||||||
} else if (nm_clear_g_free (&priv->path))
|
} else if (nm_clear_g_free (&priv->path))
|
||||||
_notify (self, PROP_PATH);
|
_notify (self, PROP_PATH);
|
||||||
|
@ -1028,6 +1045,7 @@ nm_exported_object_class_init (NMExportedObjectClass *klass)
|
||||||
object_class->constructed = constructed;
|
object_class->constructed = constructed;
|
||||||
object_class->notify = nm_exported_object_notify;
|
object_class->notify = nm_exported_object_notify;
|
||||||
object_class->dispose = dispose;
|
object_class->dispose = dispose;
|
||||||
|
object_class->get_property = get_property;
|
||||||
|
|
||||||
obj_properties[PROP_PATH] =
|
obj_properties[PROP_PATH] =
|
||||||
g_param_spec_string (NM_EXPORTED_OBJECT_PATH, "", "",
|
g_param_spec_string (NM_EXPORTED_OBJECT_PATH, "", "",
|
||||||
|
|
Loading…
Reference in a new issue