diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-10-15 02:45:50 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-10-15 02:45:50 +0000 |
commit | 24966789fc551c90857a848cebae75917fa9cc2d (patch) | |
tree | 30fae10e06f643d665a9ff88e9f47f3da63faf45 /src/service.c | |
parent | 7251f3df13dc2503791fc7d1b485a48636a15884 (diff) | |
parent | ee53f5d18009dba3cf69ddb2e2135ae2197c43b2 (diff) | |
download | ayatana-indicator-power-24966789fc551c90857a848cebae75917fa9cc2d.tar.gz ayatana-indicator-power-24966789fc551c90857a848cebae75917fa9cc2d.tar.bz2 ayatana-indicator-power-24966789fc551c90857a848cebae75917fa9cc2d.zip |
Add mock battery support to make QA testing easier. Fixes: 1373511
Approved by: Antti Kaijanmäki, PS Jenkins bot, Ted Gould
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c index 32cec38..6bae06e 100644 --- a/src/service.c +++ b/src/service.c @@ -51,6 +51,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; enum { PROP_0, + PROP_BUS, PROP_DEVICE_PROVIDER, LAST_PROP }; @@ -839,6 +840,7 @@ on_bus_acquired (GDBusConnection * connection, g_debug ("bus acquired: %s", name); p->conn = g_object_ref (G_OBJECT (connection)); + g_object_notify_by_pspec (G_OBJECT(self), properties[PROP_BUS]); /* export the battery properties */ indicator_power_notifier_set_bus (p->notifier, connection); @@ -977,6 +979,10 @@ my_get_property (GObject * o, switch (property_id) { + case PROP_BUS: + g_value_set_object (value, p->conn); + break; + case PROP_DEVICE_PROVIDER: g_value_set_object (value, p->device_provider); break; @@ -1113,6 +1119,13 @@ indicator_power_service_class_init (IndicatorPowerServiceClass * klass) properties[PROP_0] = NULL; + properties[PROP_BUS] = g_param_spec_object ( + "bus", + "Bus", + "GDBusConnection for exporting menus/actions", + G_TYPE_OBJECT, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + properties[PROP_DEVICE_PROVIDER] = g_param_spec_object ( "device-provider", "Device Provider", |