From a3ba8d575e972ec1ee18b29007c58276625e77d3 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 28 Apr 2013 04:12:00 +0200 Subject: Store just the filename if the sound file comes from the default sound dir And get rid of some hardcoding while we're at it --- src/common/cfgfiles.c | 2 +- src/common/cfgfiles.h | 2 ++ src/common/text.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 4ceb35b2..4e7dad5f 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -840,7 +840,7 @@ load_config (void) g_mkdir (buf, 0700); g_free (buf); - buf = g_build_filename (get_xdir (), "sounds", NULL); + buf = g_build_filename (get_xdir (), HEXCHAT_SOUND_DIR, NULL); g_mkdir (buf, 0700); g_free (buf); } diff --git a/src/common/cfgfiles.h b/src/common/cfgfiles.h index 3feb6a31..103466f3 100644 --- a/src/common/cfgfiles.h +++ b/src/common/cfgfiles.h @@ -69,4 +69,6 @@ struct prefs #define TYPE_INT 1 #define TYPE_BOOL 2 +#define HEXCHAT_SOUND_DIR "sounds" + #endif diff --git a/src/common/text.c b/src/common/text.c index 3fb69dc9..98ddd775 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -2231,7 +2231,7 @@ sound_play (const char *file, gboolean quiet) } else { - wavfile = g_build_filename (get_xdir (), "sounds", file, NULL); + wavfile = g_build_filename (get_xdir (), HEXCHAT_SOUND_DIR, file, NULL); } if (g_access (wavfile, R_OK) == 0) -- cgit 1.4.1