summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-23 18:13:57 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-23 18:13:57 +0200
commitc47b8cd562cc66881efe257b5ebc3109e07097a9 (patch)
treec1ff82bd35bbed1cf64142dbdbe321b5201c4cdd
parent0247e33ac2dfcf141577b36a875f01192d8199b7 (diff)
properly fall back to the freedesktop theme if the configured theme doesn't exist
-rw-r--r--src/sound-theme-spec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sound-theme-spec.c b/src/sound-theme-spec.c
index 31a9cd5..02b8de2 100644
--- a/src/sound-theme-spec.c
+++ b/src/sound-theme-spec.c
@@ -636,8 +636,12 @@ static int find_sound_for_theme(ca_sound_file **f, ca_theme_data **t, const char
ca_return_val_if_fail(locale, CA_ERROR_INVALID);
ca_return_val_if_fail(profile, CA_ERROR_INVALID);
- /* First, try in the theme itself */
- if ((ret = load_theme_data(t, theme)) == CA_SUCCESS)
+ /* First, try in the theme itself, and if that fails the fallback theme */
+ if ((ret = load_theme_data(t, theme)) == CA_ERROR_NOTFOUND)
+ if (!streq(theme, FALLBACK_THEME))
+ ret = load_theme_data(t, FALLBACK_THEME);
+
+ if (ret == CA_SUCCESS)
if ((ret = find_sound_for_locale(f, *t, name, locale, profile)) != CA_ERROR_NOTFOUND)
return ret;