changeset 2471:612efbf62c35

[gaim-migrate @ 2484] hi. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 10 Oct 2001 00:26:26 +0000
parents 116ec6e7e0ed
children dd4114ed4c07
files src/prefs.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/prefs.c	Tue Oct 09 23:44:24 2001 +0000
+++ b/src/prefs.c	Wed Oct 10 00:26:26 2001 +0000
@@ -1356,6 +1356,7 @@
 
 static GtkWidget *sndent[NUM_SOUNDS];
 static GtkWidget *sndcmd = NULL;
+static char *last_sound_dir = NULL;
 
 void close_sounddialog(GtkWidget *w, GtkWidget *w2)
 {
@@ -1396,6 +1397,10 @@
 
 	/* Close the window! It's getting cold in here! */
 	close_sounddialog(NULL, sounddialog);
+
+	if (last_sound_dir)
+		g_free(last_sound_dir);
+	last_sound_dir = g_dirname(sound_file[snd]);
 }
 
 static void reset_sound(GtkWidget *button, int snd)
@@ -1409,7 +1414,6 @@
 
 static void sel_sound(GtkWidget *button, int snd)
 {
-
 	char *buf = g_malloc(BUF_LEN);
 
 	if (!sounddialog) {
@@ -1417,7 +1421,7 @@
 
 		gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog));
 
-		g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME"));
+		g_snprintf(buf, BUF_LEN - 1, "%s/", last_sound_dir ? last_sound_dir : g_get_home_dir());
 
 		gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf);