changeset 16565:06ee8064b3d0

Rename parents first, then rename/remove the dead children. Also, set the idle-setting to 'purple' if it was 'gaim' before migration.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 28 Apr 2007 03:22:34 +0000
parents 1f9cba8efdfb
children dccdd9cbe095
files libpurple/prefs.c pidgin/gtkprefs.c
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/prefs.c	Sat Apr 28 02:42:26 2007 +0000
+++ b/libpurple/prefs.c	Sat Apr 28 03:22:34 2007 +0000
@@ -1328,6 +1328,8 @@
 void
 purple_prefs_update_old()
 {
+	purple_prefs_rename("/core", "/purple");
+
 	/* Remove some no-longer-used prefs */
 	purple_prefs_remove("/purple/away/auto_response/enabled");
 	purple_prefs_remove("/purple/away/auto_response/idle_only");
@@ -1361,7 +1363,6 @@
 		purple_prefs_set_int("/purple/sound/while_status", 3);
 	}
 	purple_prefs_remove("/purple/sound/while_away");
-	purple_prefs_rename("/core", "/purple");
 }
 
 void *
--- a/pidgin/gtkprefs.c	Sat Apr 28 02:42:26 2007 +0000
+++ b/pidgin/gtkprefs.c	Sat Apr 28 03:22:34 2007 +0000
@@ -2029,8 +2029,6 @@
 void
 pidgin_prefs_init(void)
 {
-	/* only change this when we have a sane prefs migration path */
-	purple_prefs_add_none("/gaim");
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "");
 	purple_prefs_add_none("/plugins/gtk");
 
@@ -2061,7 +2059,12 @@
 								smiley_theme_pref_cb, NULL);
 }
 
-void pidgin_prefs_update_old() {
+void pidgin_prefs_update_old()
+{
+	const char *str;
+
+	purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT);
+
 	/* Rename some old prefs */
 	purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims");
 	purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats");
@@ -2076,6 +2079,9 @@
 
 	/* this string pref moved into the core, try to be friendly */
 	purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting");
+	if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) &&
+			strcmp(str, "gaim") == 0)
+		purple_prefs_set_string("/purple/away/idle_reporting", "purple");
 
 	/* Remove some no-longer-used prefs */
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts");
@@ -2125,5 +2131,4 @@
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/away");
 	purple_prefs_remove("/plugins/gtk/docklet/queue_messages");
-	purple_prefs_rename("/gaim/gtk", "/pidgin");
 }