gio: Fix application of GNetworkMonitor:network-metered patch

The wrong patch from https://bugzilla.gnome.org/show_bug.cgi?id=750282
was applied, causing test failures due to not implementing the property
on GNetworkMonitorBase (plus some other omissions).

Fix that by reverting commit a80e7db1a8
and re-applying the correct patch over the top.

https://bugzilla.gnome.org/show_bug.cgi?id=750282
This commit is contained in:
Philip Withnall
2015-07-29 11:56:41 +01:00
parent 7f195ac956
commit 6b652b1a2e
4 changed files with 35 additions and 10 deletions

View File

@@ -134,10 +134,13 @@ nm_metered_to_bool (guint nm_metered)
{
switch (nm_metered)
{
case 0: /* unknown */
case 1: /* yes */
case 3: /* guess-yes */
return TRUE;
case 0: /* unknown */
/* We default to FALSE in the unknown-because-you're-not-running-NM
* case, so we should return FALSE in the
* unknown-when-you-are-running-NM case too. */
case 2: /* no */
case 4: /* guess-no */
return FALSE;
@@ -170,7 +173,7 @@ sync_properties (GNetworkMonitorNM *nm,
else
{
/* this is only available post 1.0 */
/* this is only available post NM 1.0 */
v = g_dbus_proxy_get_cached_property (nm->priv->proxy, "Metered");
if (v == NULL)
{
@@ -202,7 +205,7 @@ sync_properties (GNetworkMonitorNM *nm,
if (new_network_metered != nm->priv->network_metered)
{
nm->priv->network_metered = new_network_metered;
g_object_notify (G_OBJECT (nm), "network-available");
g_object_notify (G_OBJECT (nm), "network-metered");
}
if (new_connectivity != nm->priv->connectivity)
{