diff src/gtkprefs.c @ 11642:58bc500cf226

[gaim-migrate @ 13919] sf patch #1324285, from Casey Harkins fix "sounds while away" in HEAD This patch adds a GaimAccount as a parameter to the sound playing functions, allowing the caller to specify the account the sound is related to. If the account is not NULL and the while_away preference is not set, then the account is checked to see if it is away, if so, the sound is not played. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 12 Oct 2005 02:27:32 +0000
parents 3a05b53a589e
children 186d2d293ef4
line wrap: on
line diff
--- a/src/gtkprefs.c	Tue Oct 11 16:20:29 2005 +0000
+++ b/src/gtkprefs.c	Wed Oct 12 02:27:32 2005 +0000
@@ -1497,21 +1497,18 @@
 test_sound(GtkWidget *button, gpointer i_am_NULL)
 {
 	char *pref;
-	gboolean temp_value1, temp_value2;
+	gboolean temp_value;
 
 	pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s",
 			gaim_gtk_sound_get_event_option(sound_row_sel));
 
-	temp_value1 = gaim_prefs_get_bool("/core/sound/while_away");
-	temp_value2 = gaim_prefs_get_bool(pref);
-
-	if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", TRUE);
-	if (!temp_value2) gaim_prefs_set_bool(pref, TRUE);
-
-	gaim_sound_play_event(sound_row_sel);
-
-	if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", FALSE);
-	if (!temp_value2) gaim_prefs_set_bool(pref, FALSE);
+	temp_value = gaim_prefs_get_bool(pref);
+
+	if (!temp_value) gaim_prefs_set_bool(pref, TRUE);
+
+	gaim_sound_play_event(sound_row_sel, NULL);
+
+	if (!temp_value) gaim_prefs_set_bool(pref, FALSE);
 
 	g_free(pref);
 }