Commit 423a2936 authored by Florian Müllner's avatar Florian Müllner

portal network monitor: Always emit changed signal on changed

The ::network-changed signal is documented to indicate any change in
network configuration, which doesn't necessarily imply a property
change - additional services becoming available after connecting to
a VPN comes to mind for instance.

In order to match the "native" network monitor's behavior, always
emit the signal when it's in response to the 'changed' D-Bus signal.

Also emit the signal unconditionally when loading the initial property
values, to allow clients to differentiate between "offline" meaning
"offline" and "offline" meaning "uninitialized".
parent 1b0aa8b6
Pipeline #28047 passed with stages
in 7 minutes and 46 seconds
......@@ -260,7 +260,6 @@ got_status (GObject *source,
GNetworkMonitorPortal *nm = G_NETWORK_MONITOR_PORTAL (data);
GError *error = NULL;
GVariant *ret;
gboolean should_emit_changed = FALSE;
GVariant *status;
gboolean available;
gboolean metered;
......@@ -297,14 +296,12 @@ got_status (GObject *source,
{
nm->priv->available = available;
g_object_notify (G_OBJECT (nm), "network-available");
should_emit_changed = TRUE;
}
if (nm->priv->metered != metered)
{
nm->priv->metered = metered;
g_object_notify (G_OBJECT (nm), "network-metered");
should_emit_changed = TRUE;
}
if (nm->priv->connectivity != connectivity &&
......@@ -312,13 +309,11 @@ got_status (GObject *source,
{
nm->priv->connectivity = connectivity;
g_object_notify (G_OBJECT (nm), "connectivity");
should_emit_changed = TRUE;
}
g_object_thaw_notify (G_OBJECT (nm));
if (should_emit_changed)
g_signal_emit_by_name (nm, "network-changed", available);
g_signal_emit_by_name (nm, "network-changed", available);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment