From 284ff75925b329b0443338660480d392f53501e1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 2 Jul 2012 14:06:58 +0200 Subject: [PATCH] upgrade_chat_theme_settings: use empathy_theme_manager_dup_theme_name_from_path() --- src/empathy-sanity-cleaning.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/empathy-sanity-cleaning.c b/src/empathy-sanity-cleaning.c index 8bc61b4c..5b366ddf 100644 --- a/src/empathy-sanity-cleaning.c +++ b/src/empathy-sanity-cleaning.c @@ -29,6 +29,8 @@ #include +#include + #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include @@ -153,29 +155,19 @@ upgrade_chat_theme_settings (void) EMPATHY_PREFS_CHAT_THEME); if (!tp_strdiff (theme, "adium")) { - gchar *path, *fullname; + gchar *path; path = g_settings_get_string (gsettings_chat, EMPATHY_PREFS_CHAT_ADIUM_PATH); - fullname = g_path_get_basename (path); - if (g_str_has_suffix (fullname, ".AdiumMessageStyle")) - { - gchar **tmp; - - tmp = g_strsplit (fullname, ".AdiumMessageStyle", 0); - new_theme = g_strdup (tmp[0]); - - g_strfreev (tmp); - } - else + new_theme = empathy_theme_manager_dup_theme_name_from_path (path); + if (new_theme == NULL) { /* Use the Classic theme as fallback */ new_theme = g_strdup ("Classic"); } g_free (path); - g_free (fullname); } else if (!tp_strdiff (theme, "gnome")) { new_theme = g_strdup ("PlanetGNOME"); } else if (!tp_strdiff (theme, "simple")) { -- 2.39.2