[gnome-power-manager/gnome-2-26] Add a trivial debug output when the sound fails to be played



commit fa4ece3957e9e37596e40b6d6a9fe20635f7d717
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jul 29 11:16:55 2009 +0100

    Add a trivial debug output when the sound fails to be played

 src/gpm-manager.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 3b223f6..8e581c4 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -167,6 +167,7 @@ gpm_manager_play (GpmManager *manager, GpmManagerSound action, gboolean force)
 	const gchar *id = NULL;
 	const gchar *desc = NULL;
 	gboolean ret;
+	gint retval;
 
 	ret = gconf_client_get_bool (manager->priv->conf, GPM_CONF_UI_ENABLE_BEEPING, NULL);
 	if (!ret && !force) {
@@ -223,9 +224,11 @@ gpm_manager_play (GpmManager *manager, GpmManagerSound action, gboolean force)
 	}
 
 	/* play the sound, using sounds from the naming spec */
-	ca_context_play (ca_gtk_context_get (), 0,
-			 CA_PROP_EVENT_ID, id,
-			 CA_PROP_EVENT_DESCRIPTION, desc, NULL);
+	retval = ca_context_play (ca_gtk_context_get (), 0,
+				  CA_PROP_EVENT_ID, id,
+				  CA_PROP_EVENT_DESCRIPTION, desc, NULL);
+	if (retval < 0)
+		egg_warning ("failed to play %s: %s", id, ca_strerror (retval));
 	return TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]