summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-02-20 15:02:37 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-02-20 15:02:37 +0100
commit33dfc13c070497b0bf27307e8b17a4c048cde235 (patch)
treec96889919ab665d3f9620743c4443b6ddc55b4b0
parentda066045e4e3ffde26e63285a818880be6ff3316 (diff)
Revert "Add option to run daemon on the session bus for testing"
This reverts commit eddcf0ef3d0b8445618e368328d7e110a83b69b3. We don't need the --test option any more now that we always run tests on a (fake) system D-BUS.
-rw-r--r--src/up-daemon.c17
-rw-r--r--src/up-daemon.h2
-rw-r--r--src/up-device.c2
-rw-r--r--src/up-kbd-backlight.c2
-rw-r--r--src/up-main.c7
-rw-r--r--src/up-qos.c2
-rw-r--r--src/up-wakeups.c2
7 files changed, 6 insertions, 28 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index 05b029c..70ccd4b 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -126,21 +126,6 @@ G_DEFINE_TYPE (UpDaemon, up_daemon, G_TYPE_OBJECT)
#define UP_DAEMON_ON_BATTERY_REFRESH_DEVICES_DELAY 1 /* seconds */
#define UP_DAEMON_POLL_BATTERY_NUMBER_TIMES 5
-/* D-BUS to connect to. Can be set to session bus for testing */
-static DBusBusType daemon_bus_type = DBUS_BUS_SYSTEM;
-
-DBusBusType
-up_daemon_get_bus_type (void)
-{
- return daemon_bus_type;
-}
-
-void
-up_daemon_set_bus_type (DBusBusType type)
-{
- daemon_bus_type = type;
-}
-
/**
* up_daemon_get_on_battery_local:
*
@@ -781,7 +766,7 @@ up_daemon_register_power_daemon (UpDaemon *daemon)
gboolean ret = FALSE;
UpDaemonPrivate *priv = daemon->priv;
- priv->connection = dbus_g_bus_get (up_daemon_get_bus_type (), &error);
+ priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (priv->connection == NULL) {
if (error != NULL) {
g_critical ("error getting system bus: %s", error->message);
diff --git a/src/up-daemon.h b/src/up-daemon.h
index 6feff2f..9c81053 100644
--- a/src/up-daemon.h
+++ b/src/up-daemon.h
@@ -67,8 +67,6 @@ GQuark up_daemon_error_quark (void);
GType up_daemon_get_type (void);
UpDaemon *up_daemon_new (void);
void up_daemon_test (gpointer user_data);
-DBusBusType up_daemon_get_bus_type (void);
-void up_daemon_set_bus_type (DBusBusType type);
/* private */
guint up_daemon_get_number_devices_of_type (UpDaemon *daemon,
diff --git a/src/up-device.c b/src/up-device.c
index efb8d72..12f32ff 100644
--- a/src/up-device.c
+++ b/src/up-device.c
@@ -889,7 +889,7 @@ up_device_init (UpDevice *device)
device->priv->during_coldplug = FALSE;
device->priv->history = up_history_new ();
- device->priv->system_bus_connection = dbus_g_bus_get (up_daemon_get_bus_type (), &error);
+ device->priv->system_bus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (device->priv->system_bus_connection == NULL) {
g_error ("error getting system bus: %s", error->message);
g_error_free (error);
diff --git a/src/up-kbd-backlight.c b/src/up-kbd-backlight.c
index 2be22b6..fc34cd7 100644
--- a/src/up-kbd-backlight.c
+++ b/src/up-kbd-backlight.c
@@ -273,7 +273,7 @@ up_kbd_backlight_init (UpKbdBacklight *kbd_backlight)
return;
}
- kbd_backlight->priv->connection = dbus_g_bus_get (up_daemon_get_bus_type (), &error);
+ kbd_backlight->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (error != NULL) {
g_warning ("Cannot connect to bus: %s", error->message);
g_error_free (error);
diff --git a/src/up-main.c b/src/up-main.c
index 9c4d681..6201a44 100644
--- a/src/up-main.c
+++ b/src/up-main.c
@@ -189,7 +189,6 @@ main (gint argc, gchar **argv)
gint retval = 1;
gboolean timed_exit = FALSE;
gboolean immediate_exit = FALSE;
- gboolean session_bus = FALSE;
guint timer_id = 0;
gboolean verbose = FALSE;
@@ -200,8 +199,6 @@ main (gint argc, gchar **argv)
{ "immediate-exit", '\0', 0, G_OPTION_ARG_NONE, &immediate_exit,
/* TRANSLATORS: exit straight away, used for automatic profiling */
_("Exit after the engine has loaded"), NULL },
- { "test", '\0', 0, G_OPTION_ARG_NONE, &session_bus,
- _("Run on the session bus (only for testing)"), NULL },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
_("Show extra debugging information"), NULL },
{ NULL}
@@ -244,9 +241,7 @@ main (gint argc, gchar **argv)
}
/* get bus connection */
- if (session_bus)
- up_daemon_set_bus_type (DBUS_BUS_SESSION);
- bus = dbus_g_bus_get (up_daemon_get_bus_type (), &error);
+ bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (bus == NULL) {
g_warning ("Couldn't connect to system bus: %s", error->message);
g_error_free (error);
diff --git a/src/up-qos.c b/src/up-qos.c
index 167ba2a..fc72643 100644
--- a/src/up-qos.c
+++ b/src/up-qos.c
@@ -581,7 +581,7 @@ up_qos_init (UpQos *qos)
if (qos->priv->fd[UP_QOS_KIND_NETWORK] < 0)
g_debug ("cannot open network device file");
- qos->priv->connection = dbus_g_bus_get (up_daemon_get_bus_type (), &error);
+ qos->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (error != NULL) {
g_warning ("Cannot connect to bus: %s", error->message);
g_error_free (error);
diff --git a/src/up-wakeups.c b/src/up-wakeups.c
index e331500..0eb8e35 100644
--- a/src/up-wakeups.c
+++ b/src/up-wakeups.c
@@ -743,7 +743,7 @@ up_wakeups_init (UpWakeups *wakeups)
wakeups->priv->has_capability = FALSE;
wakeups->priv->polling_enabled = FALSE;
- wakeups->priv->connection = dbus_g_bus_get (up_daemon_get_bus_type (), &error);
+ wakeups->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (error != NULL) {
g_warning ("Cannot connect to bus: %s", error->message);
g_error_free (error);