summaryrefslogtreecommitdiff
path: root/src/devices/nm-lldp-listener.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-03-11 14:28:43 +0100
committerThomas Haller <thaller@redhat.com>2016-03-17 15:00:48 +0100
commite1f1e07a3dc503a21f0959272729ff58c7fe9a5c (patch)
treebc4170c2948273d22cc5593e9e28b33ab7b9b8ee /src/devices/nm-lldp-listener.c
parentc68dd4a202bf88a2b7d72ab69875ec8300c34548 (diff)
downloadNetworkManager-e1f1e07a3dc503a21f0959272729ff58c7fe9a5c.tar.gz
lldp: implement properties via NM_GOBJECT_PROPERTIES_DEFINE()
Diffstat (limited to 'src/devices/nm-lldp-listener.c')
-rw-r--r--src/devices/nm-lldp-listener.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c
index 16ad59bce9..24940080d7 100644
--- a/src/devices/nm-lldp-listener.c
+++ b/src/devices/nm-lldp-listener.c
@@ -50,12 +50,9 @@ typedef struct {
GVariant *variant;
} NMLldpListenerPrivate;
-enum {
- PROP_0,
+NM_GOBJECT_PROPERTIES_DEFINE (NMLldpListener,
PROP_NEIGHBORS,
-
- LAST_PROP
-};
+);
G_DEFINE_TYPE (NMLldpListener, nm_lldp_listener, G_TYPE_OBJECT)
@@ -644,7 +641,7 @@ process_lldp_neighbors (NMLldpListener *self)
if (changed) {
nm_clear_g_variant (&priv->variant);
- g_object_notify (G_OBJECT (self), NM_LLDP_LISTENER_NEIGHBORS);
+ _notify (self, PROP_NEIGHBORS);
}
/* Since the processing of the neighbor list is potentially
@@ -751,7 +748,7 @@ nm_lldp_listener_stop (NMLldpListener *self)
g_hash_table_remove_all (priv->lldp_neighbors);
if (size) {
nm_clear_g_variant (&priv->variant);
- g_object_notify (G_OBJECT (self), NM_LLDP_LISTENER_NEIGHBORS);
+ _notify (self, PROP_NEIGHBORS);
}
}
@@ -863,12 +860,13 @@ nm_lldp_listener_class_init (NMLldpListenerClass *klass)
object_class->finalize = finalize;
object_class->get_property = get_property;
- g_object_class_install_property
- (object_class, PROP_NEIGHBORS,
- g_param_spec_variant (NM_LLDP_LISTENER_NEIGHBORS, "", "",
- G_VARIANT_TYPE ("aa{sv}"),
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
+ obj_properties[PROP_NEIGHBORS] =
+ g_param_spec_variant (NM_LLDP_LISTENER_NEIGHBORS, "", "",
+ G_VARIANT_TYPE ("aa{sv}"),
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
}