From 545e74dd116e05cbb89ce52913ce3bf797629d27 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 17 Oct 2008 12:48:28 +0000 Subject: Do not include accounts which don't have profile.. Also fix a leak. svn path=/trunk/; revision=1642 --- src/empathy-import-dialog.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c index c93555e81..f8f27f1ce 100644 --- a/src/empathy-import-dialog.c +++ b/src/empathy-import-dialog.c @@ -293,9 +293,10 @@ import_dialog_pidgin_load (void) if (!tp_strdiff ((gchar *) child->name, PIDGIN_ACCOUNT_TAG_PROTOCOL)) { + gchar *content; const gchar *protocol; - protocol = (gchar *) xmlNodeGetContent (child); + protocol = content = (gchar *) xmlNodeGetContent (child); if (g_str_has_prefix (protocol, "prpl-")) protocol += 5; @@ -306,6 +307,10 @@ import_dialog_pidgin_load (void) protocol = "groupwise"; data->profile = mc_profile_lookup (protocol); + g_free (content); + + if (data->profile == NULL) + break; } /* Username and IRC server. */ @@ -376,7 +381,7 @@ import_dialog_pidgin_load (void) /* If we have the needed settings, add the account data to the list, * otherwise free the data */ - if (g_hash_table_size (data->settings) > 0) + if (data->profile != NULL && g_hash_table_size (data->settings) > 0) accounts = g_list_prepend (accounts, data); else import_dialog_account_data_free (data); -- cgit v1.2.3