comparison libpurple/sound-theme.c @ 25094:c32dd71d0658

Fixed a few small problems with the sound loader and sound theme
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Fri, 27 Jun 2008 18:04:29 +0000
parents cf7625d4d7e0
children fbf72bbd1084
comparison
equal deleted inserted replaced
25093:e8be608b6bab 25094:c32dd71d0658
142 142
143 g_return_val_if_fail(filename, NULL); 143 g_return_val_if_fail(filename, NULL);
144 144
145 full = g_build_filename(dir, filename, NULL); 145 full = g_build_filename(dir, filename, NULL);
146 146
147 g_free(dir);
148 g_free(filename);
149
150 return full; 147 return full;
151 } 148 }
152 149
153 void 150 void
154 purple_sound_theme_set_file(PurpleSoundTheme *theme, 151 purple_sound_theme_set_file(PurpleSoundTheme *theme,
155 const gchar *event, 152 const gchar *event,
156 const gchar *filename) 153 const gchar *filename)
157 { 154 {
158 PurpleSoundThemePrivate *priv; 155 PurpleSoundThemePrivate *priv;
159 g_return_if_fail(PURPLE_IS_SOUND_THEME(theme)); 156 g_return_if_fail(PURPLE_IS_SOUND_THEME(theme));
157
158 priv = PURPLE_SOUND_THEME_GET_PRIVATE(theme);
160 159
161 priv = PURPLE_SOUND_THEME_GET_PRIVATE(theme); 160 if (filename != NULL)g_hash_table_replace(priv->sound_files,
162
163 if (filename)g_hash_table_replace(priv->sound_files,
164 g_strdup(event), 161 g_strdup(event),
165 g_strdup(filename)); 162 g_strdup(filename));
166 else g_hash_table_remove(priv->sound_files, event); 163 else g_hash_table_remove(priv->sound_files, event);
167 } 164 }
168 165