Skip to content

Commit

Permalink
tests/twisted/fake-network-monitor: implement the "network-metered" a…
Browse files Browse the repository at this point in the history
…nd "connectivity" properties of GNetworkMonitor

"connectivity" is required since glib 2.44
"network-metered" is required since glib 2.46

https://bugs.freedesktop.org/show_bug.cgi?id=96763
  • Loading branch information
gkiagia committed Jul 1, 2016
1 parent cd976d2 commit 71ee133
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/twisted/fake-network-monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ static GType fake_network_monitor_get_type (void);
enum
{
PROP_0,
PROP_NETWORK_AVAILABLE
PROP_NETWORK_AVAILABLE,
PROP_NETWORK_METERED,
PROP_CONNECTIVITY
};

static void initable_iface_init (GInitableIface *);
Expand Down Expand Up @@ -80,7 +82,13 @@ fake_network_monitor_get_property (GObject *object,
case PROP_NETWORK_AVAILABLE:
g_value_set_boolean (value, self->available);
break;

case PROP_NETWORK_METERED:
g_value_set_boolean (value, FALSE);
break;
case PROP_CONNECTIVITY:
g_value_set_enum (value, self->available ?
G_NETWORK_CONNECTIVITY_FULL : G_NETWORK_CONNECTIVITY_LOCAL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
Expand Down Expand Up @@ -111,6 +119,10 @@ fake_network_monitor_class_init (FakeNetworkMonitorClass *cls)

g_object_class_override_property (oclass, PROP_NETWORK_AVAILABLE,
"network-available");
g_object_class_override_property (oclass, PROP_NETWORK_METERED,
"network-metered");
g_object_class_override_property (oclass, PROP_CONNECTIVITY,
"connectivity");
}

static void
Expand Down

0 comments on commit 71ee133

Please sign in to comment.