aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-sanity-cleaning.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-02 18:58:56 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-02 19:00:56 +0800
commit9b222761cc9995a09f37b7537a12e4955b586323 (patch)
treedb1925d6d43a85bcb9bb49c1626a0237c46525a2 /src/empathy-sanity-cleaning.c
parent5e112661cca767870225936428515a82b2f6f82c (diff)
downloadgsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.tar
gsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.tar.gz
gsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.tar.bz2
gsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.tar.lz
gsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.tar.xz
gsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.tar.zst
gsoc2013-empathy-9b222761cc9995a09f37b7537a12e4955b586323.zip
Store the theme name in the 'theme' gsettings key
The 'adium-path' key is now deprecated as we lookup the theme path from its name.
Diffstat (limited to 'src/empathy-sanity-cleaning.c')
-rw-r--r--src/empathy-sanity-cleaning.c47
1 files changed, 35 insertions, 12 deletions
diff --git a/src/empathy-sanity-cleaning.c b/src/empathy-sanity-cleaning.c
index b14f4f527..8bc61b4cf 100644
--- a/src/empathy-sanity-cleaning.c
+++ b/src/empathy-sanity-cleaning.c
@@ -144,8 +144,8 @@ static void
upgrade_chat_theme_settings (void)
{
GSettings *gsettings_chat;
- gchar *theme;
- const char *adium_theme, *variant = "";
+ gchar *theme, *new_theme = NULL;
+ const char *variant = "";
gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
@@ -153,33 +153,56 @@ upgrade_chat_theme_settings (void)
EMPATHY_PREFS_CHAT_THEME);
if (!tp_strdiff (theme, "adium")) {
- goto finally;
+ gchar *path, *fullname;
+
+ 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
+ {
+ /* Use the Classic theme as fallback */
+ new_theme = g_strdup ("Classic");
+ }
+
+ g_free (path);
+ g_free (fullname);
} else if (!tp_strdiff (theme, "gnome")) {
- adium_theme = "PlanetGNOME";
+ new_theme = g_strdup ("PlanetGNOME");
} else if (!tp_strdiff (theme, "simple")) {
- adium_theme = "Boxes";
+ new_theme = g_strdup ("Boxes");
variant = "Simple";
} else if (!tp_strdiff (theme, "clean")) {
- adium_theme = "Boxes";
+ new_theme = g_strdup ("Boxes");
variant = "Clean";
} else if (!tp_strdiff (theme, "blue")) {
- adium_theme = "Boxes";
+ new_theme = g_strdup ("Boxes");
variant = "Blue";
} else {
- adium_theme = "Classic";
+ /* Assume that's an Adium theme name. The theme manager will fallback to
+ * 'Classic' if it can't find it. */
+ goto finally;
}
- DEBUG ("Migrating to '%s' variant '%s'", adium_theme, variant);
+ DEBUG ("Migrating to '%s' variant '%s'", new_theme, variant);
g_settings_set_string (gsettings_chat,
- EMPATHY_PREFS_CHAT_THEME, "adium");
- g_settings_set_string (gsettings_chat,
- EMPATHY_PREFS_CHAT_ADIUM_PATH, adium_theme);
+ EMPATHY_PREFS_CHAT_THEME, new_theme);
g_settings_set_string (gsettings_chat,
EMPATHY_PREFS_CHAT_THEME_VARIANT, variant);
finally:
g_free (theme);
+ g_free (new_theme);
g_object_unref (gsettings_chat);
}