aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-02 16:32:01 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-02 16:32:01 +0800
commit2daf6b4066dbde6fdcaa3aee6d85d67f3353bfac (patch)
tree1f0a9794b8c5e741ade07afc45262c81df381529 /src
parentfa00d369ea01b464f62a7835e8f61d65f94bc29f (diff)
downloadgsoc2013-empathy-2daf6b4066dbde6fdcaa3aee6d85d67f3353bfac.tar.gz
gsoc2013-empathy-2daf6b4066dbde6fdcaa3aee6d85d67f3353bfac.tar.zst
gsoc2013-empathy-2daf6b4066dbde6fdcaa3aee6d85d67f3353bfac.zip
move theme migration code to sanity-cleaning.c
That's where this kind of code is meant to be.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-sanity-cleaning.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/empathy-sanity-cleaning.c b/src/empathy-sanity-cleaning.c
index 70e5de273..b14f4f527 100644
--- a/src/empathy-sanity-cleaning.c
+++ b/src/empathy-sanity-cleaning.c
@@ -38,7 +38,7 @@
* If the number stored in gsettings is lower than it, all the tasks will
* be executed.
*/
-#define SANITY_CLEANING_NUMBER 2
+#define SANITY_CLEANING_NUMBER 3
static void
account_update_parameters_cb (GObject *source,
@@ -141,12 +141,56 @@ set_facebook_account_fallback_server (TpAccountManager *am)
}
static void
+upgrade_chat_theme_settings (void)
+{
+ GSettings *gsettings_chat;
+ gchar *theme;
+ const char *adium_theme, *variant = "";
+
+ gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
+
+ theme = g_settings_get_string (gsettings_chat,
+ EMPATHY_PREFS_CHAT_THEME);
+
+ if (!tp_strdiff (theme, "adium")) {
+ goto finally;
+ } else if (!tp_strdiff (theme, "gnome")) {
+ adium_theme = "PlanetGNOME";
+ } else if (!tp_strdiff (theme, "simple")) {
+ adium_theme = "Boxes";
+ variant = "Simple";
+ } else if (!tp_strdiff (theme, "clean")) {
+ adium_theme = "Boxes";
+ variant = "Clean";
+ } else if (!tp_strdiff (theme, "blue")) {
+ adium_theme = "Boxes";
+ variant = "Blue";
+ } else {
+ adium_theme = "Classic";
+ }
+
+ DEBUG ("Migrating to '%s' variant '%s'", adium_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);
+ g_settings_set_string (gsettings_chat,
+ EMPATHY_PREFS_CHAT_THEME_VARIANT, variant);
+
+finally:
+ g_free (theme);
+ g_object_unref (gsettings_chat);
+}
+
+static void
run_sanity_cleaning_tasks (TpAccountManager *am)
{
DEBUG ("Starting sanity cleaning tasks");
fix_xmpp_account_priority (am);
set_facebook_account_fallback_server (am);
+ upgrade_chat_theme_settings ();
}
static void