summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-07-20 14:54:15 +0200
committerThomas Haller <thaller@redhat.com>2020-07-23 15:29:22 +0200
commite9b84221de7d8fe0aae39f0946d1c1473bc45949 (patch)
treef86d6d7956ab03cb6a6be89a92a4f7bbbc23b4b3
parentabce54822249374b01010c73ac676a360581e22c (diff)
downloadNetworkManager-e9b84221de7d8fe0aae39f0946d1c1473bc45949.tar.gz
device: emit rx-bytes/tx-bytes change notification together
This also groups the PropertiesChanged signal on D-Bus.
-rw-r--r--src/devices/nm-device.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 90ca3eddd5..797de61488 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2197,17 +2197,23 @@ _stats_update_counters (NMDevice *self,
guint64 rx_bytes)
{
NMDevicePrivate *priv;
+ gboolean tx_changed = FALSE;
+ gboolean rx_changed = FALSE;
priv = NM_DEVICE_GET_PRIVATE (self);
if (priv->stats.tx_bytes != tx_bytes) {
priv->stats.tx_bytes = tx_bytes;
- _notify (self, PROP_STATISTICS_TX_BYTES);
+ tx_changed = TRUE;
}
if (priv->stats.rx_bytes != rx_bytes) {
priv->stats.rx_bytes = rx_bytes;
- _notify (self, PROP_STATISTICS_RX_BYTES);
+ rx_changed = TRUE;
}
+
+ nm_gobject_notify_together (self,
+ tx_changed ? PROP_STATISTICS_TX_BYTES : PROP_0,
+ rx_changed ? PROP_STATISTICS_RX_BYTES : PROP_0);
}
static void