pidgin.next.major: 1b0275bd: Drop the .gaim -> .purple migration code

rlaager at pidgin.im rlaager at pidgin.im
Thu Mar 17 23:01:30 EDT 2011


----------------------------------------------------------------------
Revision: 1b0275bd7ec6ff5c9cb2a1b7a0a60c36091448a6
Parent:   e0601402c70cf63ee69761b6879032cc74fbb6b4
Author:   rlaager at pidgin.im
Date:     03/17/11 22:59:12
Branch:   im.pidgin.pidgin.next.major
URL: http://d.pidgin.im/viewmtn/revision/info/1b0275bd7ec6ff5c9cb2a1b7a0a60c36091448a6

Changelog: 

Drop the .gaim -> .purple migration code

Changes against parent e0601402c70cf63ee69761b6879032cc74fbb6b4

  patched  ChangeLog.API
  patched  finch/finch.c
  patched  finch/gntprefs.c
  patched  libpurple/account.c
  patched  libpurple/buddyicon.c
  patched  libpurple/core.c
  patched  libpurple/core.h
  patched  libpurple/internal.h
  patched  pidgin/gtkmain.c
  patched  pidgin/gtkprefs.c

-------------- next part --------------
============================================================
--- libpurple/core.c	2431d70fed20726a6a5ad9ac00b90938d628f01d
+++ libpurple/core.c	39189ce244cb493567c1d4f35049c11e0275898d
@@ -371,386 +371,6 @@ purple_core_ensure_single_instance()
 	return is_single_instance;
 }
 
-static gboolean
-move_and_symlink_dir(const char *path, const char *basename, const char *old_base, const char *new_base, const char *relative)
-{
-	char *new_name = g_build_filename(new_base, basename, NULL);
-#ifndef _WIN32
-	char *old_name;
-#endif
-	if (g_rename(path, new_name))
-	{
-		purple_debug_error("core", "Error renaming %s to %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-		                   path, new_name, g_strerror(errno));
-		g_free(new_name);
-		return FALSE;
-	}
-	g_free(new_name);
-
-#ifndef _WIN32
-	/* NOTE: This new_name is relative. */
-	new_name = g_build_filename(relative, basename, NULL);
-	old_name = g_build_filename(old_base, basename, NULL);
-	if (symlink(new_name, old_name))
-	{
-		purple_debug_warning("core", "Error symlinking %s to %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-		                     old_name, new_name, g_strerror(errno));
-	}
-	g_free(old_name);
-	g_free(new_name);
-#endif
-
-	return TRUE;
-}
-
-gboolean
-purple_core_migrate(void)
-{
-	const char *user_dir = purple_user_dir();
-	char *old_user_dir = g_strconcat(purple_home_dir(),
-	                                 G_DIR_SEPARATOR_S ".gaim", NULL);
-	char *status_file;
-	FILE *fp;
-	GDir *dir;
-	GError *err;
-	const char *entry;
-#ifndef _WIN32
-	char *logs_dir;
-#endif
-	char *old_icons_dir;
-
-	if (!g_file_test(old_user_dir, G_FILE_TEST_EXISTS))
-	{
-		/* ~/.gaim doesn't exist, so there's nothing to migrate. */
-		g_free(old_user_dir);
-		return TRUE;
-	}
-
-	status_file = g_strconcat(user_dir, G_DIR_SEPARATOR_S "migrating", NULL);
-
-	if (g_file_test(user_dir, G_FILE_TEST_EXISTS))
-	{
-		/* If we're here, we have both ~/.gaim and .purple. */
-
-		if (!g_file_test(status_file, G_FILE_TEST_EXISTS))
-		{
-			/* There's no "migrating" status file,
-			 * so ~/.purple is all up to date. */
-			g_free(status_file);
-			g_free(old_user_dir);
-			return TRUE;
-		}
-	}
-
-	/* If we're here, it's time to migrate from ~/.gaim to ~/.purple. */
-
-        /* Ensure the user directory exists */
-	if (!g_file_test(user_dir, G_FILE_TEST_IS_DIR))
-	{
-		if (g_mkdir(user_dir, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
-		{
-			purple_debug_error("core", "Error creating directory %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-			                   user_dir, g_strerror(errno));
-			g_free(status_file);
-			g_free(old_user_dir);
-			return FALSE;
-		}
-	}
-
-	/* This writes ~/.purple/migrating, which allows us to detect
-	 * incomplete migrations and properly retry. */
-	if (!(fp = g_fopen(status_file, "w")))
-	{
-		purple_debug_error("core", "Error opening file %s for writing: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-		                   status_file, g_strerror(errno));
-		g_free(status_file);
-		g_free(old_user_dir);
-		return FALSE;
-	}
-	fclose(fp);
-
-	/* Open ~/.gaim so we can loop over its contents. */
-	err = NULL;
-	if (!(dir = g_dir_open(old_user_dir, 0, &err)))
-	{
-		purple_debug_error("core", "Error opening directory %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-		                   status_file,
-		                   (err ? err->message : "Unknown error"));
-		if (err)
-			g_error_free(err);
-		g_free(status_file);
-		g_free(old_user_dir);
-		return FALSE;
-	}
-
-	/* Loop over the contents of ~/.gaim */
-	while ((entry = g_dir_read_name(dir)))
-	{
-		char *name = g_build_filename(old_user_dir, entry, NULL);
-
-#ifndef _WIN32
-		/* Deal with symlinks... */
-		if (g_file_test(name, G_FILE_TEST_IS_SYMLINK))
-		{
-			/* We're only going to duplicate a logs symlink. */
-			if (purple_strequal(entry, "logs"))
-			{
-				char *link;
-				err = NULL;
-
-				if ((link = g_file_read_link(name, &err)) == NULL)
-				{
-					char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL);
-					purple_debug_error("core", "Error reading symlink %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-					                   name_utf8 ? name_utf8 : name, err->message);
-					g_free(name_utf8);
-					g_error_free(err);
-					g_free(name);
-					g_dir_close(dir);
-					g_free(status_file);
-					g_free(old_user_dir);
-					return FALSE;
-				}
-
-				logs_dir = g_build_filename(user_dir, "logs", NULL);
-
-				if (purple_strequal(link, "../.purple/logs") ||
-				    purple_strequal(link, logs_dir))
-				{
-					/* If the symlink points to the new directory, we're
-					 * likely just trying again after a failed migration,
-					 * so there's no need to fail here. */
-					g_free(link);
-					g_free(logs_dir);
-					continue;
-				}
-
-				/* In case we are trying again after a failed migration, we need
-				 * to unlink any existing symlink.  If it's a directory, this
-				 * will fail, and so will the symlink below, which is good
-				 * because the user should sort things out. */
-				g_unlink(logs_dir);
-
-				/* Relative links will most likely still be
-				 * valid from ~/.purple, though it's not
-				 * guaranteed.  Oh well. */
-				if (symlink(link, logs_dir))
-				{
-					purple_debug_error("core", "Error symlinking %s to %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-					                   logs_dir, link, g_strerror(errno));
-					g_free(link);
-					g_free(name);
-					g_free(logs_dir);
-					g_dir_close(dir);
-					g_free(status_file);
-					g_free(old_user_dir);
-					return FALSE;
-				}
-
-				g_free(link);
-				g_free(logs_dir);
-				continue;
-			}
-
-			/* Ignore all other symlinks. */
-			continue;
-		}
-#endif
-
-		/* Deal with directories... */
-		if (g_file_test(name, G_FILE_TEST_IS_DIR))
-		{
-			if (purple_strequal(entry, "icons"))
-			{
-				/* This is a special case for the Album plugin, which
-				 * stores data in the icons folder.  We're not copying
-				 * the icons directory over because previous bugs
-				 * meant that it filled up with junk for many users.
-				 * This is a great time to purge it. */
-
-				GDir *icons_dir;
-				char *new_icons_dir;
-				const char *icons_entry;
-
-				err = NULL;
-				if (!(icons_dir = g_dir_open(name, 0, &err)))
-				{
-					purple_debug_error("core", "Error opening directory %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-					                   name,
-					                   (err ? err->message : "Unknown error"));
-					if (err)
-						g_error_free(err);
-					g_free(name);
-					g_dir_close(dir);
-					g_free(status_file);
-					g_free(old_user_dir);
-					return FALSE;
-				}
-
-				new_icons_dir = g_build_filename(user_dir, "icons", NULL);
-			        /* Ensure the new icon directory exists */
-				if (!g_file_test(new_icons_dir, G_FILE_TEST_IS_DIR))
-				{
-					if (g_mkdir(new_icons_dir, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
-					{
-						purple_debug_error("core", "Error creating directory %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-						                   new_icons_dir, g_strerror(errno));
-						g_free(new_icons_dir);
-						g_dir_close(icons_dir);
-						g_free(name);
-						g_dir_close(dir);
-						g_free(status_file);
-						g_free(old_user_dir);
-						return FALSE;
-					}
-				}
-
-				while ((icons_entry = g_dir_read_name(icons_dir)))
-				{
-					char *icons_name = g_build_filename(name, icons_entry, NULL);
-
-					if (g_file_test(icons_name, G_FILE_TEST_IS_DIR))
-					{
-						if (!move_and_symlink_dir(icons_name, icons_entry,
-						                          name, new_icons_dir, "../../.purple/icons"))
-						{
-							g_free(icons_name);
-							g_free(new_icons_dir);
-							g_dir_close(icons_dir);
-							g_free(name);
-							g_dir_close(dir);
-							g_free(status_file);
-							g_free(old_user_dir);
-							return FALSE;
-						}
-					}
-					g_free(icons_name);
-				}
-
-				g_dir_close(icons_dir);
-			}
-			else if (purple_strequal(entry, "plugins"))
-			{
-				/* Do nothing, because we broke plugin compatibility.
-				 * This means that the plugins directory gets left behind. */
-			}
-			else
-			{
-				/* All other directories are moved and symlinked. */
-				if (!move_and_symlink_dir(name, entry, old_user_dir, user_dir, "../.purple"))
-				{
-					g_free(name);
-					g_dir_close(dir);
-					g_free(status_file);
-					g_free(old_user_dir);
-					return FALSE;
-				}
-			}
-		}
-		else if (g_file_test(name, G_FILE_TEST_IS_REGULAR))
-		{
-			/* Regular files are copied. */
-
-			char *new_name;
-			FILE *new_file;
-
-			if (!(fp = g_fopen(name, "rb")))
-			{
-				purple_debug_error("core", "Error opening file %s for reading: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-				                   name, g_strerror(errno));
-				g_free(name);
-				g_dir_close(dir);
-				g_free(status_file);
-				g_free(old_user_dir);
-				return FALSE;
-			}
-
-			new_name = g_build_filename(user_dir, entry, NULL);
-			if (!(new_file = g_fopen(new_name, "wb")))
-			{
-				purple_debug_error("core", "Error opening file %s for writing: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-				                   new_name, g_strerror(errno));
-				fclose(fp);
-				g_free(new_name);
-				g_free(name);
-				g_dir_close(dir);
-				g_free(status_file);
-				g_free(old_user_dir);
-				return FALSE;
-			}
-
-			while (!feof(fp))
-			{
-				unsigned char buf[256];
-				size_t size;
-
-				size = fread(buf, 1, sizeof(buf), fp);
-				if (size != sizeof(buf) && !feof(fp))
-				{
-					purple_debug_error("core", "Error reading %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-					                   name, g_strerror(errno));
-					fclose(new_file);
-					fclose(fp);
-					g_free(new_name);
-					g_free(name);
-					g_dir_close(dir);
-					g_free(status_file);
-					g_free(old_user_dir);
-					return FALSE;
-				}
-
-				if (!fwrite(buf, size, 1, new_file) && ferror(new_file) != 0)
-				{
-					purple_debug_error("core", "Error writing %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-					                   new_name, g_strerror(errno));
-					fclose(new_file);
-					fclose(fp);
-					g_free(new_name);
-					g_free(name);
-					g_dir_close(dir);
-					g_free(status_file);
-					g_free(old_user_dir);
-					return FALSE;
-				}
-			}
-
-			if (fclose(new_file))
-			{
-				purple_debug_error("core", "Error writing: %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-				                   new_name, g_strerror(errno));
-			}
-			if (fclose(fp))
-			{
-				purple_debug_warning("core", "Error closing %s: %s\n",
-				                     name, g_strerror(errno));
-			}
-			g_free(new_name);
-		}
-		else
-			purple_debug_warning("core", "Not a regular file or directory: %s\n", name);
-
-		g_free(name);
-	}
-
-	/* The migration was successful, so delete the status file. */
-	if (g_unlink(status_file))
-	{
-		purple_debug_error("core", "Error unlinking file %s: %s. Please report this at " PURPLE_DEVEL_WEBSITE "\n",
-		                   status_file, g_strerror(errno));
-		g_free(status_file);
-		return FALSE;
-	}
-
-	old_icons_dir = g_build_filename(old_user_dir, "icons", NULL);
-	_purple_buddy_icon_set_old_icons_dir(old_icons_dir);
-	g_free(old_icons_dir);
-
-	g_free(old_user_dir);
-
-	g_free(status_file);
-	return TRUE;
-}
-
 GHashTable* purple_core_get_ui_info() {
 	PurpleCoreUiOps *ops = purple_core_get_ui_ops();
 
============================================================
--- libpurple/core.h	e9a6b60675c0cd296605c67366d37c3e90200900
+++ libpurple/core.h	a97aec8abae23b87c688a59c430035017d6a8600
@@ -156,17 +156,6 @@ PurpleCoreUiOps *purple_core_get_ui_ops(
 PurpleCoreUiOps *purple_core_get_ui_ops(void);
 
 /**
- * Migrates from <tt>.gaim</tt> to <tt>.purple</tt>.
- *
- * UIs <strong>must not</strong> call this if they have been told to use a
- * custom user directory.
- *
- * @return A boolean indicating success or migration failure. On failure,
- *         the application must display an error to the user and then exit.
- */
-gboolean purple_core_migrate(void);
-
-/**
  * Ensures that only one instance is running.  If libpurple is built with D-Bus
  * support, this checks if another process owns the libpurple bus name and if
  * so whether that process is using the same configuration directory as this
============================================================
--- pidgin/gtkprefs.c	0c5c84d96b4716aeb51f83beabbf3cca2baeba48
+++ pidgin/gtkprefs.c	b45b1844bd0bdedd2ece81582fa5f6c2eec275f1
@@ -2857,8 +2857,6 @@ pidgin_prefs_update_old(void)
 {
 	const char *str = NULL;
 
-	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");
@@ -2882,12 +2880,6 @@ pidgin_prefs_update_old(void)
 		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")) &&
-			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");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style");
============================================================
--- libpurple/account.c	ae1bbe60d7f44c53c7d2d37a4136cf40b3e340ee
+++ libpurple/account.c	885ba9333c80b0546ef1e4f7f18f07ceb54cf1c4
@@ -921,15 +921,6 @@ parse_account(xmlnode *node)
 		{
 			purple_buddy_icons_set_account_icon(ret, (guchar *)contents, len);
 		}
-		else
-		{
-			/* Try to see if the icon got left behind in the old cache. */
-			g_free(filename);
-			filename = g_build_filename(g_get_home_dir(), ".gaim", "icons", data, NULL);
-			if (g_file_get_contents(filename, &contents, &len, NULL)) {
-				purple_buddy_icons_set_account_icon(ret, (guchar*)contents, len);
-			}
-		}
 
 		g_free(filename);
 		g_free(data);
============================================================
--- libpurple/internal.h	0eca1a9615e1e02d72d139eba8a70fbc54a9bb9e
+++ libpurple/internal.h	1c1b26aed5bc39d969e39938f2789211cd0220e1
@@ -176,12 +176,6 @@ _purple_buddy_icons_blist_loaded_cb(void
 void
 _purple_buddy_icons_blist_loaded_cb(void);
 
-/* This is for the purple_core_migrate() code to tell the buddy
- * icon subsystem about the old icons directory so it can
- * migrate any icons in use. */
-void
-_purple_buddy_icon_set_old_icons_dir(const char *dirname);
-
 /**
  * Creates a connection to the specified account and either connects
  * or attempts to register a new account.  If you are logging in,
============================================================
--- libpurple/buddyicon.c	a51bd088d98387c193a3283e0d44c55f84e5a30e
+++ libpurple/buddyicon.c	a2fa9803756be3f0772326767df5d54667f5613f
@@ -105,9 +105,6 @@ static gboolean    icon_caching  = TRUE;
 /** "Should icons be cached to disk?" */
 static gboolean    icon_caching  = TRUE;
 
-/* For ~/.gaim to ~/.purple migration. */
-static char *old_icons_dir = NULL;
-
 static void delete_buddy_icon_settings(PurpleBlistNode *node, const char *setting_name);
 
 /*
@@ -977,12 +974,6 @@ purple_buddy_icons_set_custom_icon(Purpl
 	return purple_buddy_icons_node_set_custom_icon((PurpleBlistNode*)contact, icon_data, icon_len);
 }
 
-void
-_purple_buddy_icon_set_old_icons_dir(const char *dirname)
-{
-	old_icons_dir = g_strdup(dirname);
-}
-
 static void
 delete_buddy_icon_settings(PurpleBlistNode *node, const char *setting_name)
 {
@@ -995,133 +986,6 @@ delete_buddy_icon_settings(PurpleBlistNo
 	}
 }
 
-static void
-migrate_buddy_icon(PurpleBlistNode *node, const char *setting_name,
-                   const char *dirname, const char *filename)
-{
-	char *path;
-
-	if (filename[0] != '/')
-	{
-		path = g_build_filename(dirname, filename, NULL);
-		if (g_file_test(path, G_FILE_TEST_EXISTS))
-		{
-			g_free(path);
-			return;
-		}
-		g_free(path);
-
-		path = g_build_filename(old_icons_dir, filename, NULL);
-	}
-	else
-		path = g_strdup(filename);
-
-	if (g_file_test(path, G_FILE_TEST_EXISTS))
-	{
-		guchar *icon_data;
-		size_t icon_len;
-		FILE *file;
-		char *new_filename;
-
-		if (!read_icon_file(path, &icon_data, &icon_len))
-		{
-			g_free(path);
-			delete_buddy_icon_settings(node, setting_name);
-			return;
-		}
-
-		if (icon_data == NULL || icon_len <= 0)
-		{
-			/* This really applies to the icon_len check.
-			 * icon_data should never be NULL if
-			 * read_icon_file() returns TRUE. */
-			purple_debug_error("buddyicon", "Empty buddy icon file: %s\n", path);
-			delete_buddy_icon_settings(node, setting_name);
-			g_free(path);
-			return;
-		}
-
-		g_free(path);
-
-		new_filename = purple_util_get_image_filename(icon_data, icon_len);
-		if (new_filename == NULL)
-		{
-			purple_debug_error("buddyicon",
-				"New icon filename is NULL. This should never happen! "
-				"The old filename was: %s\n", path);
-			delete_buddy_icon_settings(node, setting_name);
-			g_return_if_reached();
-		}
-
-		path = g_build_filename(dirname, new_filename, NULL);
-		if ((file = g_fopen(path, "wb")) != NULL)
-		{
-			if (!fwrite(icon_data, icon_len, 1, file))
-			{
-				purple_debug_error("buddyicon", "Error writing %s: %s\n",
-				                   path, g_strerror(errno));
-			}
-			else
-				purple_debug_info("buddyicon", "Wrote migrated cache file: %s\n", path);
-
-			fclose(file);
-		}
-		else
-		{
-			purple_debug_error("buddyicon", "Unable to create file %s: %s\n",
-			                   path, g_strerror(errno));
-			g_free(new_filename);
-			g_free(path);
-
-			delete_buddy_icon_settings(node, setting_name);
-			return;
-		}
-		g_free(path);
-
-		purple_blist_node_set_string(node,
-		                             setting_name,
-		                             new_filename);
-		ref_filename(new_filename);
-
-		g_free(new_filename);
-
-		if (purple_strequal(setting_name, "buddy_icon"))
-		{
-			const char *hash;
-
-			hash = purple_blist_node_get_string(node, "avatar_hash");
-			if (hash != NULL)
-			{
-				purple_blist_node_set_string(node, "icon_checksum", hash);
-				purple_blist_node_remove_setting(node, "avatar_hash");
-			}
-			else
-			{
-				PurpleAccount *account = purple_buddy_get_account((PurpleBuddy *)node);
-				const char *prpl_id = purple_account_get_protocol_id(account);
-
-				if (g_str_equal(prpl_id, "prpl-yahoo") || g_str_equal(prpl_id, "prpl-yahoojp"))
-				{
-					int checksum = purple_blist_node_get_int(node, "icon_checksum");
-					if (checksum != 0)
-					{
-						char *checksum_str = g_strdup_printf("%i", checksum);
-						purple_blist_node_remove_setting(node, "icon_checksum");
-						purple_blist_node_set_string(node, "icon_checksum", checksum_str);
-						g_free(checksum_str);
-					}
-				}
-			}
-		}
-	}
-	else
-	{
-		purple_debug_error("buddyicon", "Old icon file doesn't exist: %s\n", path);
-		delete_buddy_icon_settings(node, setting_name);
-		g_free(path);
-	}
-}
-
 void
 _purple_buddy_icons_account_loaded_cb()
 {
@@ -1153,22 +1017,6 @@ _purple_buddy_icons_blist_loaded_cb()
 	PurpleBlistNode *node = purple_blist_get_root();
 	const char *dirname = purple_buddy_icons_get_cache_dir();
 
-	/* Doing this once here saves having to check it inside a loop. */
-	if (old_icons_dir != NULL)
-	{
-		if (!g_file_test(dirname, G_FILE_TEST_IS_DIR))
-		{
-			purple_debug_info("buddyicon", "Creating icon cache directory.\n");
-
-			if (g_mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0)
-			{
-				purple_debug_error("buddyicon",
-				                   "Unable to create directory %s: %s\n",
-				                   dirname, g_strerror(errno));
-			}
-		}
-	}
-
 	while (node != NULL)
 	{
 		if (PURPLE_BLIST_NODE_IS_BUDDY(node))
@@ -1178,26 +1026,17 @@ _purple_buddy_icons_blist_loaded_cb()
 			filename = purple_blist_node_get_string(node, "buddy_icon");
 			if (filename != NULL)
 			{
-				if (old_icons_dir != NULL)
+				char *path = g_build_filename(dirname, filename, NULL);
+				if (!g_file_test(path, G_FILE_TEST_EXISTS))
 				{
-					migrate_buddy_icon(node,
-					                   "buddy_icon",
-					                   dirname, filename);
+					purple_blist_node_remove_setting(node,
+					                                 "buddy_icon");
+					purple_blist_node_remove_setting(node,
+					                                 "icon_checksum");
 				}
 				else
-				{
-					char *path = g_build_filename(dirname, filename, NULL);
-					if (!g_file_test(path, G_FILE_TEST_EXISTS))
-					{
-						purple_blist_node_remove_setting(node,
-						                                 "buddy_icon");
-						purple_blist_node_remove_setting(node,
-						                                 "icon_checksum");
-					}
-					else
-						ref_filename(filename);
-					g_free(path);
-				}
+					ref_filename(filename);
+				g_free(path);
 			}
 		}
 		else if (PURPLE_BLIST_NODE_IS_CONTACT(node) ||
@@ -1209,24 +1048,15 @@ _purple_buddy_icons_blist_loaded_cb()
 			filename = purple_blist_node_get_string(node, "custom_buddy_icon");
 			if (filename != NULL)
 			{
-				if (old_icons_dir != NULL)
+				char *path = g_build_filename(dirname, filename, NULL);
+				if (!g_file_test(path, G_FILE_TEST_EXISTS))
 				{
-					migrate_buddy_icon(node,
-					                   "custom_buddy_icon",
-					                   dirname, filename);
+					purple_blist_node_remove_setting(node,
+					                                 "custom_buddy_icon");
 				}
 				else
-				{
-					char *path = g_build_filename(dirname, filename, NULL);
-					if (!g_file_test(path, G_FILE_TEST_EXISTS))
-					{
-						purple_blist_node_remove_setting(node,
-						                                 "custom_buddy_icon");
-					}
-					else
-						ref_filename(filename);
-					g_free(path);
-				}
+					ref_filename(filename);
+				g_free(path);
 			}
 		}
 		node = purple_blist_node_next(node, TRUE);
@@ -1298,11 +1128,9 @@ purple_buddy_icons_uninit()
 	g_hash_table_destroy(icon_data_cache);
 	g_hash_table_destroy(icon_file_cache);
 	g_hash_table_destroy(pointer_icon_cache);
-	g_free(old_icons_dir);
 	g_free(cache_dir);
 
 	cache_dir = NULL;
-	old_icons_dir = NULL;
 }
 
 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height)
============================================================
--- ChangeLog.API	c372bdf25d0162ea1cc45c25b1f75fb3f9c360f4
+++ ChangeLog.API	0a48ab6ca29ee8630b04516a0780c3188b3dd40a
@@ -1,5 +1,10 @@ Pidgin and Finch: The Pimpin' Penguin IM
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
+version 3.0.0 (??/??/????):
+	libpurple:
+		Removed:
+		* purple_core_migrate
+
 version 2.8.0 (??/??/????):
 	libpurple:
 		Added:
============================================================
--- pidgin/gtkmain.c	2ddda6f732ef7bde66e305cbbc7bad80da2a3484
+++ pidgin/gtkmain.c	0d0d1e4bd2866ae20a7a0088ba9b336cc23fdd1f
@@ -496,7 +496,6 @@ int main(int argc, char *argv[])
 	int opt;
 	gboolean gui_check;
 	gboolean debug_enabled;
-	gboolean migration_failed = FALSE;
 	GList *active_accounts;
 	struct stat st;
 
@@ -728,16 +727,6 @@ int main(int argc, char *argv[])
 
 	purple_debug_set_enabled(debug_enabled);
 
-	/* If we're using a custom configuration directory, we
-	 * do NOT want to migrate, or weird things will happen. */
-	if (opt_config_dir_arg == NULL)
-	{
-		if (!purple_core_migrate())
-		{
-			migration_failed = TRUE;
-		}
-	}
-
 	search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL);
 	gtk_rc_add_default_file(search_path);
 	g_free(search_path);
@@ -763,37 +752,6 @@ int main(int argc, char *argv[])
 	winpidgin_init(hint);
 #endif
 
-	if (migration_failed)
-	{
-		char *old = g_strconcat(purple_home_dir(),
-		                        G_DIR_SEPARATOR_S ".gaim", NULL);
-		const char *text = _(
-			"%s encountered errors migrating your settings "
-			"from %s to %s. Please investigate and complete the "
-			"migration by hand. Please report this error at http://developer.pidgin.im");
-		GtkWidget *dialog;
-
-		dialog = gtk_message_dialog_new(NULL,
-		                                0,
-		                                GTK_MESSAGE_ERROR,
-		                                GTK_BUTTONS_CLOSE,
-		                                text, PIDGIN_NAME,
-		                                old, purple_user_dir());
-		g_free(old);
-
-		g_signal_connect_swapped(dialog, "response",
-		                         G_CALLBACK(gtk_main_quit), NULL);
-
-		gtk_widget_show_all(dialog);
-
-		gtk_main();
-
-#ifdef HAVE_SIGNAL_H
-		g_free(segfault_message);
-#endif
-		return 0;
-	}
-
 	purple_core_set_ui_ops(pidgin_core_get_ui_ops());
 	purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops());
 
============================================================
--- finch/finch.c	170d09042925f551e122f422b1e4f213952960fb
+++ finch/finch.c	2810feba2e67b4282ffd5a9bd7d31b49b3f732e9
@@ -334,29 +334,6 @@ init_libpurple(int argc, char **argv)
 	/* We don't want debug-messages to show up and corrupt the display */
 	purple_debug_set_enabled(debug_enabled);
 
-	/* If we're using a custom configuration directory, we
-	 * do NOT want to migrate, or weird things will happen. */
-	if (opt_config_dir_arg == NULL)
-	{
-		if (!purple_core_migrate())
-		{
-			char *old = g_strconcat(purple_home_dir(),
-			                        G_DIR_SEPARATOR_S ".gaim", NULL);
-			char *text = g_strdup_printf(_(
-				"%s encountered errors migrating your settings "
-				"from %s to %s. Please investigate and complete the "
-				"migration by hand. Please report this error at http://developer.pidgin.im"), _("Finch"),
-				old, purple_user_dir());
-
-			g_free(old);
-
-			purple_print_utf8_to_console(stderr, text);
-			g_free(text);
-
-			return 0;
-		}
-	}
-
 	purple_core_set_ui_ops(gnt_core_get_ui_ops());
 	purple_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops());
 	purple_idle_set_ui_ops(finch_idle_get_ui_ops());
============================================================
--- finch/gntprefs.c	134b6f26598164780cd23e3160009dd78790d3ce
+++ finch/gntprefs.c	6c98c1fc12a3c374472e4833a0450cdd0edefa90
@@ -62,14 +62,6 @@ void finch_prefs_update_old()
 
 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


More information about the Commits mailing list