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/main.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/main.c')
-rw-r--r-- | src/main.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -18,14 +18,13 @@ */ #include <locale.h> -#include <stdlib.h> /* exit() */ +#include <glib.h> #include <glib/gi18n.h> -#include <gio/gio.h> #include "device.h" -#include "device-provider-upower.h" #include "service.h" +#include "testing.h" /*** **** @@ -41,8 +40,8 @@ on_name_lost (gpointer instance G_GNUC_UNUSED, gpointer loop) int main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED) { - IndicatorPowerDeviceProvider * device_provider; IndicatorPowerService * service; + IndicatorPowerTesting * testing; GMainLoop * loop; /* boilerplate i18n */ @@ -51,8 +50,8 @@ main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED) textdomain (GETTEXT_PACKAGE); /* run */ - device_provider = indicator_power_device_provider_upower_new (); - service = indicator_power_service_new (device_provider); + service = indicator_power_service_new (NULL); + testing = indicator_power_testing_new (service); loop = g_main_loop_new (NULL, FALSE); g_signal_connect (service, INDICATOR_POWER_SERVICE_SIGNAL_NAME_LOST, G_CALLBACK(on_name_lost), loop); @@ -61,6 +60,6 @@ main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED) /* cleanup */ g_main_loop_unref (loop); g_clear_object (&service); - g_clear_object (&device_provider); + g_clear_object (&testing); return 0; } |