changeset 31000:8a03508dd6f4

Change the "Manual" browser command pref's name to allow for a relatively simple migration of an existing value from the path pref to the new string pref. As I note in the comment in the migration code, I realize this will break things for and confuse those users who use the same config directory for mutliple versions of Pidgin, but I'm not inclined to devise a solution that will make that work. The solution I've implemented fixes the most important case--users who upgrade. The rest of the world will just have to move on. Refs #12024.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Mon, 20 Sep 2010 03:53:47 +0000
parents 0d2503e532a7
children f1a80dd255cb
files pidgin/gtkprefs.c
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Mon Sep 20 03:35:16 2010 +0000
+++ b/pidgin/gtkprefs.c	Mon Sep 20 03:53:47 2010 +0000
@@ -2828,7 +2828,7 @@
 	/* Browsers */
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers");
 	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT);
-	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/command", "");
+	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", "");
 	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla");
 #endif
 
@@ -2859,7 +2859,7 @@
 void
 pidgin_prefs_update_old(void)
 {
-	const char *str;
+	const char *str = NULL;
 
 	purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT);
 
@@ -2875,6 +2875,17 @@
 	purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors",
 									 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting");
 
+	/*
+	 * this path pref changed to a string, so migrate.  I know this will break
+	 * things for and confuse users that use multiple versions with the same
+	 * config directory, but I'm not inclined to want to deal with that at the
+	 * moment. -- rekkanoryo
+	 */
+	if((str = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")) != NULL) {
+		purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", str);
+		purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command");
+	}
+
 	/* 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")) &&