aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-migrate.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-10-02 19:54:42 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-10-02 19:54:42 +0800
commit09d4af6fff63dd112b8bb42087f14f7018e2f78c (patch)
tree991537a9ea1d8487334f6fb299098daf425f9db8 /mail/em-migrate.c
parent79521efaeecfbaf717e465670fcd2724aea53578 (diff)
downloadgsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar
gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.gz
gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.bz2
gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.lz
gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.xz
gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.tar.zst
gsoc2013-evolution-09d4af6fff63dd112b8bb42087f14f7018e2f78c.zip
** Fixes bug #469657
2007-10-02 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #469657 * addressbook/importers/evolution-ldif-importer.c: * calendar/gui/comp-editor-factory.c: * composer/e-msg-composer.c: * e-util/e-config-listener.c: * mail/em-composer-prefs.c: * mail/em-folder-tree-model.c: * mail/em-format.c: * mail/em-format-html.c: * mail/em-migrate.c: * mail/em-subscribe-editor.c: * mail/mail-component.c: * mail/mail-send-recv.c: * mail/message-list.c: * mail/importers/elm-importer.c: * plugins/exchange-operations/exchange-folder-size-display.c: * plugins/mono/mono-plugin.c: * shell/e-shell-settings-dialog.c: * tools/killev.c: * widgets/table/e-table-extras.c: * widgets/table/e-table-selection-model.c: Use destroy functions in GHashTables to simplify memory management. svn path=/trunk/; revision=34344
Diffstat (limited to 'mail/em-migrate.c')
-rw-r--r--mail/em-migrate.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 2fc53ebf5f..4e8f3e3c61 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -233,10 +233,8 @@ static GHashTable *accounts_1_0 = NULL;
static GHashTable *accounts_name_1_0 = NULL;
static void
-imap_folder_info_1_0_free(gpointer key, gpointer value, gpointer user_data)
+imap_folder_info_1_0_free (struct _imap_folder_info_1_0 *fi)
{
- struct _imap_folder_info_1_0 *fi = value;
-
g_free(fi->folder);
g_free(fi);
}
@@ -249,17 +247,10 @@ account_info_1_0_free (struct _account_info_1_0 *ai)
g_free(ai->base_uri);
g_free(ai->u.imap.namespace);
g_free(ai->u.imap.namespace_full);
- g_hash_table_foreach(ai->u.imap.folders, (GHFunc) imap_folder_info_1_0_free, NULL);
g_hash_table_destroy(ai->u.imap.folders);
g_free(ai);
}
-static void
-accounts_1_0_free(gpointer key, gpointer value, gpointer user_data)
-{
- account_info_1_0_free(value);
-}
-
static char *
get_base_uri(const char *val)
{
@@ -394,7 +385,10 @@ read_imap_storeinfo (struct _account_info_1_0 *si)
char *buf, *folder, dir_sep, *path, *name, *p;
struct _imap_folder_info_1_0 *fi;
- si->u.imap.folders = g_hash_table_new (g_str_hash, g_str_equal);
+ si->u.imap.folders = g_hash_table_new_full (
+ g_str_hash, g_str_equal,
+ (GDestroyNotify) NULL,
+ (GDestroyNotify) imap_folder_info_1_0_free);
/* get details from uri first */
name = strstr (si->uri, ";override_namespace");
@@ -545,14 +539,16 @@ load_accounts_1_0 (xmlDocPtr doc)
static int
em_migrate_1_0 (const char *evolution_dir, xmlDocPtr config_xmldb, xmlDocPtr filters, xmlDocPtr vfolders, CamelException *ex)
{
- accounts_1_0 = g_hash_table_new (g_str_hash, g_str_equal);
+ accounts_1_0 = g_hash_table_new_full (
+ g_str_hash, g_str_equal,
+ (GDestroyNotify) NULL,
+ (GDestroyNotify) account_info_1_0_free);
accounts_name_1_0 = g_hash_table_new (g_str_hash, g_str_equal);
load_accounts_1_0 (config_xmldb);
upgrade_xml_uris(filters, upgrade_xml_uris_1_0);
upgrade_xml_uris(vfolders, upgrade_xml_uris_1_0);
- g_hash_table_foreach (accounts_1_0, (GHFunc) accounts_1_0_free, NULL);
g_hash_table_destroy (accounts_1_0);
g_hash_table_destroy (accounts_name_1_0);