changeset 16565:ac0d07c7fd90

Pref migration for finch.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 28 Apr 2007 04:08:46 +0000
parents dccdd9cbe095
children 45773df910e0
files finch/finch.c finch/gntprefs.c finch/gntprefs.h
diffstat 3 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/finch/finch.c	Sat Apr 28 03:24:18 2007 +0000
+++ b/finch/finch.c	Sat Apr 28 04:08:46 2007 +0000
@@ -328,8 +328,7 @@
 	/* TODO: Move prefs loading into purple_prefs_init() */
 	purple_prefs_load();
 	purple_prefs_update_old();
-	purple_prefs_rename("/gaim/gnt", "/finch");
-	purple_prefs_rename("/purple/gnt", "/finch");
+	finch_prefs_update_old();
 
 	/* load plugins we had when we quit */
 	purple_plugins_load_saved("/finch/plugins/loaded");
--- a/finch/gntprefs.c	Sat Apr 28 03:24:18 2007 +0000
+++ b/finch/gntprefs.c	Sat Apr 28 04:08:46 2007 +0000
@@ -42,9 +42,19 @@
 
 	purple_prefs_add_none("/finch/conversations");
 	purple_prefs_add_bool("/finch/conversations/timestamps", TRUE);
-	purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE); /* XXX: Not functional yet */
+	purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE);
+}
+
+void finch_prefs_update_old()
+{
+	const char *str = NULL;
+
 	purple_prefs_rename("/gaim/gnt", "/finch");
 	purple_prefs_rename("/purple/gnt", "/finch");
+
+	if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) &&
+			strcmp(str, "gaim") == 0)
+		purple_prefs_set_string("/purple/away/idle_reporting", "purple");
 }
 
 typedef struct
--- a/finch/gntprefs.h	Sat Apr 28 03:24:18 2007 +0000
+++ b/finch/gntprefs.h	Sat Apr 28 04:08:46 2007 +0000
@@ -40,6 +40,10 @@
  */
 void finch_prefs_show_all(void);
 
+/**
+ * You don't need to know about this.
+ */
+void finch_prefs_update_old(void);
 /*@}*/
 
 #endif