[gnome-settings-daemon] power: Remove canberra_context struct member
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Remove canberra_context struct member
- Date: Fri, 25 Jan 2013 19:35:53 +0000 (UTC)
commit a33bb5a3678997d7369874739572294c12e61990
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 25 20:05:46 2013 +0100
power: Remove canberra_context struct member
Just as fast to call ca_gtk_context_get() directly
plugins/power/gsd-power-manager.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index f0451d6..5a03815 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -194,7 +194,6 @@ struct GsdPowerManagerPrivate
gint kbd_brightness_pre_dim;
/* Sound */
- ca_context *canberra_context;
ca_proplist *critical_alert_loop_props;
guint32 critical_alert_timeout_id;
@@ -258,7 +257,7 @@ static gboolean
play_loop_timeout_cb (GsdPowerManager *manager)
{
ca_context *context;
- context = ca_gtk_context_get_for_screen (gdk_screen_get_default ());
+ context = ca_gtk_context_get ();
ca_context_play_full (context, 0,
manager->priv->critical_alert_loop_props,
NULL,
@@ -1505,7 +1504,7 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
notify_notification_show (manager->priv->notification_low, NULL);
/* play the sound, using sounds from the naming spec */
- ca_context_play (manager->priv->canberra_context, 0,
+ ca_context_play (ca_gtk_context_get (), 0,
CA_PROP_EVENT_ID, "battery-low",
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Battery is low"), NULL);
@@ -1689,7 +1688,7 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
default:
/* play the sound, using sounds from the naming spec */
- ca_context_play (manager->priv->canberra_context, 0,
+ ca_context_play (ca_gtk_context_get (), 0,
CA_PROP_EVENT_ID, "battery-caution",
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
@@ -1819,7 +1818,7 @@ engine_charge_action (GsdPowerManager *manager, UpDevice *device)
notify_notification_show (manager->priv->notification_low, NULL);
/* play the sound, using sounds from the naming spec */
- ca_context_play (manager->priv->canberra_context, 0,
+ ca_context_play (ca_gtk_context_get (), 0,
CA_PROP_EVENT_ID, "battery-caution",
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
@@ -2279,7 +2278,7 @@ static void
do_lid_open_action (GsdPowerManager *manager)
{
/* play a sound, using sounds from the naming spec */
- ca_context_play (manager->priv->canberra_context, 0,
+ ca_context_play (ca_gtk_context_get (), 0,
CA_PROP_EVENT_ID, "lid-open",
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Lid has been opened"),
@@ -2317,7 +2316,7 @@ static void
do_lid_closed_action (GsdPowerManager *manager)
{
/* play a sound, using sounds from the naming spec */
- ca_context_play (manager->priv->canberra_context, 0,
+ ca_context_play (ca_gtk_context_get (), 0,
CA_PROP_EVENT_ID, "lid-close",
/* TRANSLATORS: this is the sound description */
CA_PROP_EVENT_DESCRIPTION, _("Lid has been closed"),
@@ -3471,7 +3470,6 @@ gsd_power_manager_start (GsdPowerManager *manager,
NULL);
manager->priv->devices_array = g_ptr_array_new_with_free_func (g_object_unref);
- manager->priv->canberra_context = ca_gtk_context_get_for_screen (gdk_screen_get_default ());
/* create a fake virtual composite battery */
manager->priv->device_composite = up_device_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]