# HG changeset patch # User Eric Warmenhoven # Date 1002673586 0 # Node ID 612efbf62c35a1e09f74527c5d7c38ad0ef9d5e4 # Parent 116ec6e7e0edcc5a6225a9ab7597c578c576b47b [gaim-migrate @ 2484] hi. committer: Tailor Script diff -r 116ec6e7e0ed -r 612efbf62c35 src/prefs.c --- 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);